Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Clearing of JSP Page and form data from cache  RSS feed

Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

<meta http-equiv="no-cache">
<meta HTTP-EQUIV="expires" CONTENT="-1">

in the JSP, but seems to not work.

Any help would be greatly appreciated.

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!