• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

how expire a page

 
Ranch Hand
Posts: 260
  • 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 ]
 
Ranch Hand
Posts: 375
  • 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.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kashif can you explain that in little bit detail....

Thanx in Advance
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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.
 
Ranch Hand
Posts: 87
  • 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.
 
Ranch Hand
Posts: 415
  • 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
 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!