jspÇå³ýÒ³Ãæsession¡¢cookies»º´æ
Ò»¡¢Çå³ýÒ³Ã滺´æ
ÔÚjspÒ³Àï
<%response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
response.flushBuffer();%>
ÔÚhtmlÒ³Àï
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
¶þ¡¢Çå³ýcookie
<%
Cookie killMyCookie = new Cookie("mycookie", null);
killMyCookie.setMaxAge(0);
killMyCookie.setPath("/");
response.addCookie(killMyCookie);
%>
Èý¡¢Çå³ýsession
Çå³ýsession·½·¨
<%@ page language="java" %>
<%
session.invalidate();
%>
ÔÚÒ³Ãæ¹Ø±ÕʱÇå³ýsession£¬ÐèÒª²¶»ñwindows.oncloseʼþ£¬ÔÙµ÷ÓÃÇå³ýsession·½·¨
Ïà¹ØÎĵµ£º
1 web·þÎñÆ÷{TOMCAT(JSP)¡¢WEBLOGIC(JSP) }
Ó¦Ó÷þÎñÆ÷
We ......
½ñÌìÓÖÓöµ½ÂÒÂëÎÊÌâ,¿ÉÕæ·³.ΪʲôTOMCAT¾Í²»ÄÜ×Ô¶¯ÅжÏÏîÄ¿µÄ±àÂë,¶øÒ»¶¨ÒªÏîÄ¿×ñÑTOMCATµÄ±àÂë.
˵˵½â¾ö·½·¨°É:
ÔÚTOMCATµÄSERVER.XMLÅäÖÃÎļþÖеÄconnectorÖÐÌí¼ÓURIEncoding="UTF-8"ÊôÐÔ,Èç
<Connector port="88" maxHttpHeaderSize="8192" maxThreads="20" minSpareThreads="5" maxSpareThreads="10"
e ......
title: JSP·ÖÒ³¼¼ÊõʵÏÖ
summary:ʹÓù¤¾ßÀàʵÏÖͨÓ÷ÖÒ³´¦Àí
author: evan_zhao
email: evan_zhao@hotmail.com
¡¡¡¡Ä¿Ç°±È½Ï¹ã·ºÊ¹ÓõķÖÒ³·½Ê½Êǽ«²éѯ½á¹û»º´æÔÚHttpSession»òÓÐ״̬beanÖУ¬·Ò³µÄʱºò´Ó»º´æÖÐÈ¡³öÒ»Ò³Êý¾ÝÏÔʾ¡£ÕâÖÖ·½·¨ÓÐÁ½¸öÖ÷ÒªµÄȱµã£ºÒ»ÊÇÓû§¿ÉÄÜ¿´µ½µÄÊǹýÆÚÊý¾Ý£»¶þÊÇÈç¹ûÊ ......
JSPÖеÄÌøת£º
(1). forward()·½·¨
ʹÓõ½javax.servlet.RequestDispatcherÀà
RequestDispatcher rd = getServletContext().getRequestDispatcher("url");
rd.forward(requestVar,requestVar); //´«µÝservletµÄÈë¿Ú²ÎÊý
/*forwardº ......
Ò»¡¢JSPµÄ¼¼ÊõÔÀí
¶þ¡¢JSPµÄ×¢ÊͺÍÉùÃ÷
JSP×¢ÊÍÓÃÓÚ±íÃ÷ÔÚ³ÌÐò¿ª·¢¹ý³ÌÖеĿª·¢Ìáʾ£¬²»»áÊä³öµ½¿Í»§¶Ë£»
<%--×¢ÊÍÄÚÈÝ--%> —— JSP×¢ÊÍ
<£¡--×¢ÊÍÄÚÈÝ--£¡> —&md ......