• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make page to expire

 
sachin dabhade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have a problem in page expiry.
i want that the user should not get the content of the previous page on hitting browsers back button.
i want that a page expiry message should be displayed.
i have tried with
resp.setHeader("Expires","Tues,01 jan 1970 00:00:00 GMT");

but the page content is still visible.
what do i do ?
thanks in advance
sachin
 
David Freels
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using the html meta tag.
<META http-equiv="Expires" content="Tue, 20 Aug 1996 14:25:27 GMT">
David
Sun Certified Programmer for the Java2 Platform
 
sachin dabhade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David Freels:
Have you tried using the html meta tag.
<META http-equiv="Expires" content="Tue, 20 Aug 1996 14:25:27 GMT">
David
Sun Certified Programmer for the Java2 Platform

****************
i tried using
<META http-equiv="Expires" content="Tue, 20 Aug 1996 14:25:27 GMT">
its not working
i also tried with changing date to "tue,1 jan 1970 00:00:00 GMT ">
but its not working as well !
is their any method in servlet for this?
this is i suppose a html tag.
sachin
 
Maky Chopra
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this at the top of your jsp pages
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
 
sachin dabhade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mak Bhandari:
try this at the top of your jsp pages
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>

============
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
is working but what i want is when user hits back button,
message should be displayed that the page you are requesting has expired.
with the cache control method,the page is vanished.so when i hit back,the very first page is displayed in my case.
if there are 10 links then on hitting back,its going to first page.
what i want is it should go to ninth page but could not display
the content of ninth page
sachin
 
sachin dabhade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its urgent please.
i tried with your suggestions but colu snot get an exact point

with the cache control method,the page is vanished.so when i hit back,the very first page is displayed in my case.
if there are 10 links then on hitting back,its going to first page.
what i want is it should go to ninth page but could not display
the content of ninth page
sachin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic