Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How To Automatically expire a Page

Posted on 2002-04-01
5
Medium Priority
?
220 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 40 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
Integration Management Part 2
Screencast - Getting to Know the Pipeline

963 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