File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Clearing of JSP Page and  form data from cache Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Clearing of JSP Page and  form data from cache" Watch "Clearing of JSP Page and  form data from cache" New topic
Author

Clearing of JSP Page and form data from cache

lekurwale amol
Ranch Hand

Joined: Apr 22, 2010
Posts: 55
Hi,
I am developing an application, where the user logs in and is forwarded to home page.
Now, my requirement is :
1. When user logs in, then from home page, if he is clicking on browser's back, then again forward, he should not be allowed to view home page.
2. On firefox, as well as on IE, if we press back for a page which caused some action, the browser asks (in case of firefox) 'Do you want to resend...' etc. It means browser is caching the form data. How to avoid caching of form data/jsp page.? I tried using

<% response.setHeader("Cache-Control","no-cache");//HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching
response.setHeader("Cache-Control","no-store"); //HTTP 1.1 %>

as well as

<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="no-cache">
<meta HTTP-EQUIV="expires" CONTENT="-1">
</head>

in the JSP, but seems to not work.

Any help would be greatly appreciated.

Regards,
Amol
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Clearing of JSP Page and form data from cache
 
Similar Threads
pressing back button after logout shows loggedin contents
Caching is not working
invalidate session object in struts2
disable the back button in webapplication
Logout Process