Solved

How To Automatically expire a Page

Posted on 2002-04-01
5
191 Views
Last Modified: 2010-04-01
Hi There
I want to expire a page say an update page once the update is successful
Sya form an edit page i direct to a servlet if it is successful i am redirecting to a viewing page wher he can view his updated accounts else he is sent back to the same edit page now what i want is that after update is successful i dont want the the user to use browser back button and insteda say that page has expired
Now how to do this

Thanks in advance
Macet
0
Comment
Question by:macet2k
5 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 6912401
<META content="0" http-equiv="expires"/>
<META content="nocache" http-equiv="pragma"/>

Place above lines into html/head.
0
 

Author Comment

by:macet2k
ID: 6912467
Well I have tried this but it does not work
It will be better if u give me some code snippets with say any 2 jsp pages itself
I have tried hard really
Macet
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 10 total points
ID: 6912876
Actually, the best thing that works in IE is to have the following:
<%
response.addHeader("Pragma" , "No-cache") ;
response.addHeader("Cache-Control, "no-cache") ;
response.addDateHeader("Expires", 0);  
%>

BOTH in the head of the of page and bottom of the page (I read this in a message board and it seems
to work for me) so the final version would be as such:

<html>
<head>
<%
response.addHeader("Pragma" , "No-cache") ;
response.addHeader("Cache-Control, "no-cache") ;
response.addDateHeader("Expires", 0);  
%>
</head>
<body>

....

</body>
<%
response.addHeader("Pragma" , "No-cache") ;
response.addHeader("Cache-Control, "no-cache") ;
response.addDateHeader("Expires", 0);  
%>
</html>

This works in NS and IE.

HTH,
CJ
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9553064
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"Accept cheekycj's comment as answer."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can I clean log of  running tomcat 7 server ? 3 126
squirrelPlay java challenge 40 158
grep code 4 183
own marker interface 1 54
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Each year, investment in cloud platforms grows more than 20% (https://www.immun.io/hubfs/Immunio_2016/Content/Marketing/Cloud-Security-Report-2016.pdf?submissionGuid=a8d80a00-6fee-4b85-81db-a4e28f681762) as an increasing number of companies begin to…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question