File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how expire a page

 
Vijay Kumar
Ranch Hand
Posts: 260
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For security purposes I would like to know how to disable
the back button in the browser and/or expire the page
similar to an online banking institution does.
e.g. when you hit the back button in the browser it gives
the warning that page has expired.

thanks
Vijay

[ April 29, 2005: Message edited by: Bear Bibeault ]
 
K Riaz
Ranch Hand
Posts: 375
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the JSP, set a meta tag to prevent it from caching the page.
 
Kutub Shaikh
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kashif can you explain that in little bit detail....

Thanx in Advance
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do some googling on "no-cache", "expires" and "pragma".

These keywords should turn up all kinds of articles on preventing browsers from caching your content.
It usually involves several approaches as different browsers and different versions of those browsers handle caching differently.
 
Gert Cuppens
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To prevent caching, you should add the following code before the <HTML> tag of your JSP.


When you call a servlet, it might be necessary to add a date/time as parameter, like I had to do in the following part of my JSP.



The idea behind this is also to prevent caching. The proxy server at work was so lazy it always showed the first movie poster over and over again. With the date as parameter I prevented caching.
 
sreenath reddy
Ranch Hand
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vijay

I will tell u one thing . u cant make button always give u that message . First thing is diable the cache as mentioned by all the above so that page wont be cached . If the request type is POST , then on clicking BACK u will get that message(Thats a warning by browser saying that data will be submitted again) , and if the request type is GET , on clicking back the request will be resubmitted directly thast all

Hope u got what i am saying . Any further queries u can mail me at sreenathn@huawei.com
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic