Solved

How To Automatically expire a Page

Posted on 2002-04-01
5
181 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A Short Story about the Best File Recovery Software – Acronis True Image 2017
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now