I found this setNoCache() code somewhere on the internet....
I have made a class called WebUtilities that has this method in it.
In my jsp I have imported the WebUtilities class
Then I just put this at the top of the jsp:
<%
      WebUtilities.setNoCache(request, response);
%>
This should disable caching of your jsp page output



public static void setNoCache(HttpServletRequest request, HttpServletResponse 
response) {
       if(request.getProtocol().compareTo ("HTTP/1.0") == 0) {
           response.setHeader ("Pragma", "no-cache");
       } else if (request.getProtocol().compareTo ("HTTP/1.1") == 0) {
           response.setHeader ("Cache-Control", "no-cache");
       }
       response.setDateHeader ("Expires", 0);
    }

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to