Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

jsp¹ýÂËÆ÷¼òд

package com.pan.encod;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class EncodFilter implements Filter {
 public void destroy() {
  
 }
 public void doFilter(ServletRequest arg0, ServletResponse arg1,
   FilterChain arg2) throws IOException, ServletException {
  
  arg0.setCharacterEncoding("GB2312");
  arg1.setCharacterEncoding("GB2312");
  arg2.doFilter(arg0, arg1);
 }
 public void init(FilterConfig arg0) throws ServletException {
  
 }
}


Ïà¹ØÎĵµ£º

¿ª·¢JSP³ÌÐò

»·¾³ÅäÖúú󣬿ª·¢JSP³ÌÐò¾Í·Ç³£¼òµ¥ÁË¡£
File-->New-->Web Project
Ôڸô°¿ÚÖÐÊäÈëһЩ¹¤³Ì»ù±¾ÐÅÏ¢£¬±ÈÈ繤³ÌÃû£¬ÕâÀïÊäÈëΪ  test1-01 
ÕâÑùÒ»¸ö»ùÓÚJSPµÄÏîÄ¿¾Í½¨Á¢ÆðÀ´ÁË¡£
 
Package  Explorer µÄÏÔʾ·½·¨£º
Windows-->Show View-->Package Explorer ÕâÑù¾ÍÄÜÏÔʾ³öÀ´À²£¡
Ï ......

JSP/XML,JavaBeanºÍCSS/XSLЭͬ¹¤×÷

1.ÔÚJSPÖÐÉú³É¶¯Ì¬XML
  ¿ÉÒÔʹÓÃJSPÉú³ÉXML,ʹÓÃCSS»òÕßXSLת»»ºÍÏÔʾXML;
  Ö»ÒªÔÚ¾²Ì¬µÄXMLÎĵµÄ£°åÖмÓÈëJava´úÂëºÍJSP±ê¼Ç£¬XML¾Í¿ÉÒÔÓо²±ä¶¯£¬²úÉú¶¯Ì¬µÄÄÚÈÝ£¬Éú³ÉXMLÎĵµµÄ·½·¨ºÜ¼òµ¥£¬Ö»ÐèÒªÔÚÎļþÖÐʹÓÃÖ¸Áîcontenttype,Èç<%@ page contenttype="text/xml"%>£»
  ÔÚXMLÎĵµÖÐͬÑù¿ÉÒÔʹ ......

JSPÄÚ²¿¶ÔÏóÏê½â

1¡¢Out¶ÔÏó
Ö÷ÒªÓÃÀ´Ïò¿Í»§¶ËÊä³ö¸÷ÖÖ¸ñʽµÄÊý¾Ý£¬²¢ÇÒ¹ÜÀíÓ¦Ó÷þÎñÆ÷ÉϵÄÊä³ö»º³åÇø£¬Out¶ÔÏóµÄ»ùÀàÊÇjavax.servlet.jsp.JspWriterÀà¡£
OutµÄÖ÷Òª·½·¨£º
out.println(DataType);»òout.print(DataType);
ʵÀý£º
<%@page language="java"
contentType="text/html;charset=gb2312"
import="java.util.*"
%>
&l ......

jspÖÐList,ArrayListµÄʹÓ÷½·¨


public static List getPageUser(int currentPage) throws Exception {//?List
         Connection conn = null;
         PreparedStatement prep = null;
         ResultSet rs = null ......

jspµÇ½·ÃÎÊÌøת


δµÇ½£¬½ûÖ¹·ÃÎÊÈκÎÒ³Ã棬×Ô¶¯Ìøתµ½µÇ½ҳ
package com.catalogeasy.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ