jsp·Åµ½WEB INFϺóÒýÓò»Í¬Ä¿Â¼µÄÎļþ,ÔõôҲÕÒ²»µ½
ÎÒ°Ñindex.jspÎļþ·Åµ½WEB-INFÏ£¬ÓÖÔÚWEB-INFϽ¨Á¢Ò»¸öĿ¼jsÓÃÀ´·ÅjavascriptÎļþ£¬Ò²¾ÍÊÇ˵index.jspºÍjsĿ¼ÊÇƽ¼¶µÄ£¬µ«ÊÇÔÚindex.jspÏÂÒýÓÃjavascriptÎļþʱÔõôҲÕÒ²»µ½¡£
WEB-INF¶ÔÓÚÓû§£¨Ò²¾ÍÊÇIE£©²»¿É¼û¡£
¶Ô²ß£¬°Ñjs·Åµ½WEB-INFÍ⣬»òÕßͨ¹ýרÃŵÄjsp/servlet/actionµÈforwardµ½ÏàÓ¦µÄ×ÊÔ´¡£
Ïà¹ØÎĵµ£º
JSP ÄÚÖöÔÏó ÊÕ²Ø
ÄÚÖöÔÏóÊDz»ÐèÒªÉùÃ÷£¬Ö±½Ó¿ÉÒÔÔÚJSPÖÐʹÓõĶÔÏó£¬JSPÓÐÒÔϼ¸ÖÖÄÚÖöÔÏó£º
1.request¶ÔÏó
request±íʾHttpServletRequest¶ÔÏó¡£Ëü°üº¬ÁËÓйØä¯ÀÀÆ÷ÇëÇóµÄÐÅÏ¢£¬²¢ÇÒÌṩÁ˼¸¸öÓÃÓÚ»ñÈ¡cookie, header, ºÍsessionÊý¾ÝµÄÓÐÓõķ½·¨¡£¿Í»§¶ËµÄÇëÇóÐÅÏ¢±»·â×°ÔÚrequest¶ÔÏóÖУ¬Í¨¹ýËü²ÅÄÜÁ˽⵽¿Í»§ ......
ÔÚʹÓÃÊý¾Ý¿âµÄ¹ý³ÌÖУ¬²»¿É±ÜÃâµÄÐèҪʹÓõ½·ÖÒ³µÄ¹¦ÄÜ£¬¿ÉÊÇJDBCµÄ¹æ·¶¶Ô´ËȴûÓкܺõĽâ¾ö¡£¶ÔÓÚÕâ¸öÐèÇóºÜ¶àÅóÓѶ¼ÓÐ×Ô¼ºµÄ½â¾ö·½°¸£¬±ÈÈçʹÓÃVectorµÈ¼¯ºÏÀàÏȱ£´æÈ¡³öµÄÊý¾ÝÔÙ·ÖÒ³¡£µ«ÕâÖÖ·½·¨µÄ¿ÉÓÃÐԺܲÓëJDBC±¾ÉíµÄ½Ó¿ÚÍêÈ«²»Í¬£¬¶Ô²»Í¬ÀàÐ͵Ä×ֶεÄÖ§³ÖÒ²²»ºÃ¡£ÕâÀïÌṩÁËÒ»Ö ......
ÔÚ¸÷ÖÖSession ¹ÜÀí·½°¸ÖУ¬ ThreadLocal ģʽµÃµ½ÁË´óÁ¿Ê¹Óá£ThreadLocal ÊÇ
JavaÖÐÒ»ÖÖ½ÏΪÌØÊâµÄḬ̈߳󶨻úÖÆ¡£Í¨¹ýThreadLocal´æÈ¡µÄÊý¾Ý£¬×ÜÊÇÓ뵱ǰÏß³ÌÏà¹Ø£¬
Ò²¾ÍÊÇ˵£¬JVM Ϊÿ¸öÔËÐеÄỊ̈߳¬°ó¶¨ÁË˽Óеı¾µØʵÀý´æÈ¡¿Õ¼ä£¬´Ó¶øΪ¶àÏ̻߳·¾³³£³ö
ÏֵIJ¢·¢·ÃÎÊÎÊÌâÌṩÁËÒ»ÖÖ¸ôÀë»úÖÆ¡£
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÖªµÀ£¬ ......
ͨ¹ýrequest.getParameter(String name)·½Ê½È¡²ÎÊýnameÖеÄֵʱ£¬ÈçºÎ½â¾öÖÐÎÄÂÒÂëÎÊÌâ
·½·¨Ò»£ºÔÚËùÓеÄÈ¡ÖµÓï¾ä֮ǰÉèÖÃrequestµÄ±àÂ뷽ʽ£¬¼´request.setCharacterEncoding("utf-8") //utf-8Ò²¿ÉÒÔΪgb2312
Ç°ÌáÌõ¼þÊÇ£º²ÎÊýnameËùÔÚµÄÒ³ÃæºÍ»ñÈ¡ ......
δµÇ½£¬½ûÖ¹·ÃÎÊÈκÎÒ³Ã棬×Ô¶¯Ìøתµ½µÇ½ҳ
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. ......