my dog learned polymorphism*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
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
 
 
subject: Clearing of JSP Page and form data from cache
 
Similar Threads
invalidate session object in struts2
Caching is not working
disable the back button in webapplication
pressing back button after logout shows loggedin contents
Logout Process