You will need to set the appropriate HTTP header attributes to prevent the
dynamic content output by the JSP page from being cached by the browser.
Just execute the following scriptlet at the beginning of your JSP pages to
prevent them from being cached at the browser. You need both the statements
to take care of some of the older browser versions.
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy
server
%>
 If the above fails, try changing the first line to
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
The difference between no-cache and no-store is a bit dodgy, but apparently
no-cache is the more polite
However, please note that there are some problems with disabling page
caching under IE 5.0 due to the unique buffering requirements of the
browser. Please see the Microsoft knowledge base for details:

<http://support.microsoft.com/support/kb/articles/Q222/0/64.ASP>
<http://support.microsoft.com/support/kb/articles/Q234/2/47.ASP>
from Jguru JSP FAQ
> -----Original Message-----
> From: ??? [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, March 21, 2001 2:15 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Caching a JSP Page
>
> All you have to do is to add these below
> <meta http-equiv="pragma" content="no-cache">
> <meta http-equiv="cache-control" content="no-cache">
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of OK Prakasan
> Sent: Wednesday, March 21, 2001 3:28 PM
> To: [EMAIL PROTECTED]
> Subject: Caching a JSP Page
>
>
> Hi All,
>      I would like to prevent  the browser from caching a JSP page.
> Please give me a solution to achieve this.
> Thanks in Advance
> Prakasan
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to