´¦Àístruts servlet jsp ÖÐÎÄÂÒÂëÎÊÌâ
Õë¶ÔgetÌá½»·½Ê½¡¢ÂÒÂë½â¾ö·½Ê½
tomcat5ÖУ¬ÎªÁ˱£Ö¤getÊý¾Ý²ÉÓÃGBK±àÂ룬ÔÚserver.xmlÖнøÐÐÁËÈçÏÂÉèÖ㺸ıäwebÈÝÆ÷ÇëÇóÊý¾ÝµÄ±àÂë¸ñʽ(¶ÔpostÇëÇó·½Ê½ÎÞЧ)
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="GBK" />
×¢Ò⣺strutsÖйýÂËÆ÷¡¢ÖØдformBeanÀïÃæreset·½·¨¡¢ÖØдactionÀïµÄprocessPreprocessor()·½·¨ ¾ù¶ÔgetÇëÇóÎÞЧ
Õë¶ÔstrutsÖÐpostÌá½»·½Ê½¡¢ÂÒÂë½â¾ö·½Ê½
·½·¨Ò»:×¢ÒâprocessActionForm()·½·¨£¬Õâ¸ö·½·¨»áÏȵ÷ÓÃActionFormµÄreset·½·¨£¬ËùÒÔÄã¿ÉÒÔÔÚÄãµÄActionFormÖÐÖØдreset·½·¨£¬ÔÚÆäÖнøÐбàÂëÉ趨È磺request.setCharacterEncoding("utf-8");ÕâÀïǧÍòҪעÒâµÄÊÇ£¬ÄãÉèÖõıàÂëºÍ·¢ËÍÇëÇóµÄÒ³ÃæµÄ±àÂë±ØÐëÒ»Ö¡£ÒÔϼ¸¸ö·½·¨Ò²ÊÇÏàͬµÄ¡£Èç¹ûҪʹÓÃValidator²å¼þ£¬ÎÒÏëʹÓÃÁËStruts¶¼»áÓÃÉϵġ£ÄÇôÔÚValidatorÖÐ±íµ¥ÊÇʹÓÃValidatorFormºÍDynaValidatorForm£¬ËûÃǶ¼ÊÇActionFormµÄ×ÓÀ࣬ÄãÒ²¿ÉÒÔÖØдreset·½·¨£¬µ±È»×î·½±ãµÄ»¹ÊÇдһ¸ö×Ô¼ºµÄ»ùÀàÀ©Õ¹ËüÃÇ£¬¶øÔÚÆäÖÐÖ»ÓÃÖØдreset()¶ø²»×öÆäËü²Ù×÷£¬È»ºóÆäËû±íµ¥¼Ì³ÐÕâ¸ö»ùÀà¡£ÕâÖÖ·½Ê½µÄȱµãÊÇÖ»Äܽâ¾ö±íµ¥ÖÐÎÄÂÒÂëÎÊÌâ¡£
public void reset(ActionMapping mapping, HttpServletRequest request) {
super.reset(mapping, request);
try {
request.setCharacterEncoding("GBK");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
·½·¨¶þ:ÔÚStruts1.11°æ±¾Ö®ºó£¬ActionServlet²»ÔÙ´¦ÀíËùÓÐÇëÇ󣬶øÊǰѴ󲿷ÖÇëÇóÅ׸øÁËRequestProcessorÀà,×÷ΪActionServletµÄÖúÊÖ.ÔÚËüµÄprocess£¨£©·½·¨Öлáµ÷ÓÃ16¸ö·½·¨.¿ÉÒÔÉùÃ÷Ò»¸öMyProRequestProcessorÀà¼Ì³ÐRequestProcessorÀ࣬ÖØдij¸ö·½·¨£¬Ìí¼Ó±àÂëµÄ´úÂë¡£ÈçÖØдprocessPreprocessor()·½·¨£
Ïà¹ØÎĵµ£º
JSP»ù±¾Óï·¨
´ó²¿·ÖJSP±»Ò»¸öÒÔ“<%” ¿ªÍ·ºÍÒÔ“%>”½áβµÄµÄ±ê¼ÇÀ¨ÔÚÆäÖС£ÔÚ¸üеÄJSP 1.1¹æ·¶³ǫ̈ºó£¬¾ÍÓÐÁËÓëXML¼æÈݵİ汾¡£
JSPÖ¸ÁîºÍ½Å±¾ÔªËØ
Directives <%@ directive %>
Declarations <%! declaration %>
Expressions <%= expression %>
Code Fragment/ ......
Ê×ÏÈÄãÒªÓÐtomcat,»¹ÒªÓÐoracle jdbcµÄjarµµµÈ»·¾³.
µÚÒ»²½: дJSP
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@(des ......
jQueryÊÇÄ¿Ç°Ò»¸öºÜÁ÷ÐеÄjs¿ò¼Ü£¬ËüÒ²ÌṩÁ˶ÔajaxºÜºÃµÄÖ§³Ö¡£Ê¹ÓÃajaxÒì²½ÇëÇóÊý¾Ýʱ£¬Èç¹û·þÎñÆ÷·µ»ØµÄÒ»¸öÁбíÊý¾Ý£¬Í¨³£µÄ×ö·¨ÊÇ°ÑÁбíÊý¾Ýת»»³Éjson¸ñʽµÄÊý¾Ý£¬È»ºó·µ»Øµ½Ò³Ã棬ʹÓÃjQuery½øÐнâÎö²¢Óñí¸ñÀ´ÏÔʾ£¬ÕâÒªÇóÄã¶Ôjavascript½âÎöjsonºÜÊì͸¡£
ÎÒÔÚÕâÀïÌṩһÖÖͶ»úÈ¡ÇɵÄ×ö·¨£¬Ê¹ÓÃjQuery·¢ËÍÒì²½ÇëÇó ......
jspÖÐÎÄÏÔʾÂÒÂë½â¾ö·½°¸2006-12-27 22:56
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
¶þ¡¢±íµ¥Ìá½»ÖÐÎÄʱ³öÏÖÂÒÂë
Èý¡¢Êý¾Ý¿âÁ¬½Ó
´ó¼ÒÔÚJSPµÄ¿ª·¢¹ý³ÌÖУ¬¾³£³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌ⣬¿ÉÄÜÒ»ÖÁÀ§ÈÅ×ÅÄú£¬ÎÒÏÖÔÚ°ÑÎÒÔÚJSP¿ª·¢ÖÐÓöµ½
µÄÖÐÎÄÂÒÂëµÄÎÊÌâ¼°½â¾ö°ì·¨Ð´³öÀ´¹©´ó¼Ò²Î¿¼¡£
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
ÏÂÃæµÄÏÔʾҳÃæ(display.jsp)¾Í³öÏÖÂÒ ......