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

jspÖвÙ×÷Cookie


Cookie¸ÅÄî:
     CookieµÄ¸ñʽʵ¼ÊÉÏÊÇÒ»¶Î´¿Îı¾ÐÅÏ¢, ÓÉ·þÎñÆ÷Ëæ×ÅÍøÒ³Ò»Æð·¢Ë͵½¿Í»§¶Ë, ²¢±£´æÔÚ¿Í»§¶ËÓ²ÅÌÖÐÖ¸¶¨µÄĿ¼µÄ. ´ó¼Ò¶¼´«ËµCookie»áÔì³ÉÑÏÖصݲȫÍþвʲôµÄ, Æäʵ²»ÊÇÕâô»ØÊÂÇé. ·þÎñÆ÷¶ÁÈ¡CookieµÄʱºò, Ö»Äܹ»¶ÁÈ¡µ½Õâ¸ö·þÎñÆ÷Ïà¹ØµÄÐÅÏ¢. ¶øÇÒ, ä¯ÀÀÆ÷Ò»°ãÖ»ÔÊÐí´æ·Å300¸öCookie, ÿ¸öÕ¾µã×î¶à´æ·Å20¸ö, ¶øÇÒ, ÿ¸öCookieµÄ´óСÏÖÔÚÔÚ4K, ¸ù±¾²»»áÕ¼ÓöàÉÙ¿Õ¼ä. ²¢ÇÒ, CookieÊÇÓÐʱЧÐÔÖʵÄ. ÀýÈç, ÉèÖÃÁËCookieµÄ´æ»îʱ¼äΪ1·ÖÖÓ, ÔòÒ»·ÖÖÓºóÕâ¸öCookie¾Í»á±»ä¯ÀÀÆ÷ɾ³ý
Cookie°æ±¾:
     Ä¿Ç°ÓÐÁ½¸ö°æ±¾:
     °æ±¾0 : ÓÉNetscape¹«Ë¾Öƶ¨µÄ£¬Ò²±»¼¸ºõËùÓеÄä¯ÀÀÆ÷Ö§³Ö. JavaÖÐΪÁ˱£³Ö¼æÈÝÐÔ, Ä¿Ç°Ö»Ö§³Öµ½°æ±¾0, CookieµÄÄÚÈÝÖв»ÄÜ¿Õ¸ñ£¬·½À¨ºÅ£¬Ô²À¨ºÅ£¬µÈÓںţ¨=£©£¬¶ººÅ£¬Ë«ÒýºÅ£¬Ð±¸Ü£¬Îʺţ¬@·ûºÅ£¬Ã°ºÅ£¬·ÖºÅ¡£
     °æ±¾1 : ¸ù¾ÝRFC 2109ÎĵµÖƶ¨µÄ. ·Å¿íÁ˺ܶàÏÞÖÆ. ÉÏÃæËùÏÞÖƵÄ×Ö·û¶¼¿ÉÒÔʹÓÃ. µ«ÎªÁ˱£³Ö¼æÈÝÐÔ, Ó¦¸Ã¾¡Á¿±ÜÃâʹÓÃÕâЩÌØÊâ×Ö·û.
JSPÖжÔCookieµÄ²Ù×÷: ÀàÐÍ ·½·¨Ãû ·½·¨½âÊÍ
String getComment() ·µ»ØcookieÖÐ×¢ÊÍ,Èç¹ûûÓÐ×¢Ê͵Ļ°½«·µ»Ø¿ÕÖµ.
String getDomain() ·µ»ØcookieÖÐCookieÊÊÓõÄÓòÃû. ʹÓÃgetDomain() ·½·¨¿ÉÒÔָʾä¯ÀÀÆ÷°ÑCookie·µ»Ø¸øͬ Ò»ÓòÄÚµÄÆäËû·þÎñÆ÷,¶øͨ³£CookieÖ»·µ»Ø¸øÓë·¢ËÍËüµÄ·þÎñÆ÷Ãû×ÖÍêÈ«ÏàͬµÄ·þÎñÆ÷¡£×¢ÒâÓòÃû±ØÐëÒԵ㿪ʼ
int getMaxAge() ·µ»ØCookie¹ýÆÚ֮ǰµÄ×î´óʱ¼ä£¬ÒÔÃë¼ÆËã¡£
String getName() ·µ»ØCookieµÄÃû×Ö
String getPath() ·µ»ØCookieÊÊÓõÄ·¾¶¡£Èç¹û²»Ö¸¶¨Â·¾¶£¬Cookie½«·µ»Ø¸øµ±Ç°Ò³ÃæËùÔÚĿ¼¼°Æä×ÓĿ¼Ï µÄËùÓÐÒ³Ãæ¡£
boolean getSecure() Èç¹ûä¯ÀÀÆ÷ͨ¹ý°²È«Ð­Òé·¢ËÍcookies½«·µ»ØtrueÖµ£¬Èç¹ûä¯ÀÀÆ÷ʹÓñê׼ЭÒéÔò·µ»ØfalseÖµ¡£
String getValue() ·µ»ØCookieµÄÖµ¡£±ÊÕßÒ²½«ÔÚºóÃæÏêϸ½éÉÜgetValue/setValue¡£
int getVersion() ·µ»ØCookieËù×ñ´ÓµÄЭÒé°æ±¾¡£
void setComment(String purpose) ÉèÖÃcookieÖÐ×¢ÊÍ
void setDomain(String pattern) ÉèÖÃcookieÖÐCookieÊÊÓõÄÓòÃû  
void setMaxAge(int expiry) ÒÔÃë¼ÆË㣬ÉèÖÃCookie¹ýÆÚʱ¼ä¡£
void setPath(String uri) Ö¸¶¨CookieÊÊÓõÄ·¾¶¡£
void setSecure(boolean flag) Ö¸³öä¯ÀÀÆ÷ʹÓõİ²È«Ð­Ò飬ÀýÈçHTTPS»òSSL¡£
void setValue(String newValue


Ïà¹ØÎĵµ£º

JSPʵÀýÒ»¡¢¹ºÎï³µ


֪ʶ׼±¸£º
JDBC·ÃÎÊÊý¾Ý¿âµÄ»ù±¾²½Öè
£¨1£©¡¢½«Êý¾Ý¿âµÄJDBCÇý¶¯¼ÓÔص½¹¤³ÌÀà¿âÖС£
£¨2£©¡¢¼ÓÔØJDBCÇý¶¯£¬²¢½«Æä×¢²áµ½DriverManagerÖС£ÏÂÃæÊÇһЩÖ÷Á÷Êý¾Ý¿âµÄJDBCÇý¶¯¼ÓÔØ×¢²áÂ룺
¢Ù¡¢oracleÊý¾Ý¿â
Class.forName(“oracle.jdbc.driver.OracleDriver”).newInstance();
¢Ú¡¢Sql Server 7.0/2000Êý¾ ......

JSPÄÚÖöÔÏóÊôÐÔ¼°·½·¨´óÈ«

1.request¶ÔÏó
    ¿Í»§¶ËµÄÇëÇóÐÅÏ¢±»·â×°ÔÚrequest¶ÔÏóÖУ¬Í¨¹ýËü²ÅÄÜÁ˽⵽¿Í»§µÄÐèÇó£¬È»ºó×ö³öÏìÓ¦¡£ËüÊÇHttpServletRequestÀàµÄʵÀý¡£
ÐòºÅ                    ·½ ·¨      & ......

̸JSPÓëXMLµÄ½»»¥

̸JSPÓëXMLµÄ½»»¥
ʹÓÃJavaServer PagesÓÐÈýÖÖ²»Í¬µÄ·½·¨ÓÃÓÚ´¦ÀíXMLÎĵµ£¬Ã¿ÖÖ·½·¨¶¼ÓÐÀûÓÚÌá¸ß·ÖÀëÒ³Ãæ´úÂëÓëXMLÊý¾ÝµÄˮƽ£¬ÓÐÀûÓÚ¼ò»¯¿ª·¢ÍøÒ³µÄ¸´ÔӶȲ¢ÇÒ¸ÄÉÆÌá¸ß×é¼þÓëÒ³Ãæ´úÂëµÄ¿ÉÖØÓÃÐÔ¡£
¡¡¡¡JavaServer Pages ( JSP)ºÍXMLÊÇSunµÄJ2EEµÄÁ½¸öÖÁ¹Ø½ôÒªµÄ×é¼þ¡£ JSPÊÇÓÃÓÚ´´½¨Ó¦ÓóÌÐò·þÎñÆ÷¶Ë³ÌÐòµÄÓÐЧ¹¤¾ß£¬¶ø¿ ......

ÈçºÎÈ¥³ýJSPÊä³öHTMLʱ²úÉúµÄ´óÁ¿¿Õ¸ñºÍ»»ÐÐ

ÔÚWEBÓ¦ÓÃÖÐ,Èç¹ûʹÓÃjsp×÷Ϊview²ãµÄÏÔʾģ°å,¶¼»á±»¿Õ¸ñ/¿Õ»»ÐÐÎÊÌâËùÀ§ÈÅ.
Õâ¸öÎÊÌâµ±ÄêÒ²À§ÈÅÁËÎұȽϳ¤µÄʱ¼ä.ÒòΪÔÚjspÄÚʹÓõÄEL±êÇ©ºÍÆäËû±êǩʱ,»á²úÉú´óÁ¿µÄ¿Õ¸ñºÍ»»Ðзû.ÀýÈç:
------- start ----------
<c:choose>
    <c:when test="${fn:length(mainPageList)>1&}&q ......

JSP¼¸ÖÖÌøת·½Ê½

1.RequestDispatcher.forward()
¡¡¡¡ ÊÇÔÚ·þÎñÆ÷¶ËÆð×÷ÓÃ,µ±Ê¹ÓÃforward()ʱ,Servlet engine´«µÝHTTPÇëÇó´Óµ±Ç°µÄServlet or JSPµ½ÁíÍâÒ»¸öServlet,JSP »òÆÕͨHTMLÎļþ,Ò²¼´ÄãµÄformÌá½»ÖÁa.jsp,ÔÚa.jspÓõ½ÁËforward()Öض¨ÏòÖÁb.jsp,´ËʱformÌá½»µÄËùÓÐÐÅÏ¢ÔÚ b.jsp¶¼¿ÉÒÔ»ñµÃ,²ÎÊý×Ô¶¯´«µÝ.
¡¡¡¡µ«forward()ÎÞ·¨Öض¨ÏòÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ