Hi all
In my application, the user can make update in some pages and I want to avoid the user going back to the update page after the update has succeed. I have seen that some website can display a "Warning Page has been expired" on the browser when I try to go to the previous page. Can anyone please how to achieve it?
Thank you !!
From Edmond
-
How to avoid user viewing the previous pages? (7 messages)
- Posted by: Edmond Hung
- Posted on: December 19 2002 07:17 EST
Threaded Messages (7)
- How to avoid user viewing the previous pages? by Web Master on December 19 2002 07:50 EST
- How to avoid user viewing the previous pages? by Brian OByrne on December 19 2002 16:38 EST
- How to avoid user viewing the previous pages? by Edmond Hung on December 21 2002 08:26 EST
- How to avoid user viewing the previous pages? by Ferhat SAVCI on December 22 2002 03:01 EST
- How to avoid user viewing the previous pages? by Brian OByrne on December 23 2002 07:59 EST
- How to avoid user viewing the previous pages? by Edmond Hung on December 21 2002 08:26 EST
- How to avoid user viewing the previous pages? by Dave Hewitt on December 23 2002 05:24 EST
- This does not work in all cases by Parag Parashar on November 30 2004 00:21 EST
-
How to avoid user viewing the previous pages?[ Go to top ]
- Posted by: Web Master
- Posted on: December 19 2002 07:50 EST
- in response to Edmond Hung
Stick this in your JSP page:
<%
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
%>
http://www.jguru.com/faq/printableview.jsp?EID=377 -
How to avoid user viewing the previous pages?[ Go to top ]
- Posted by: Brian OByrne
- Posted on: December 19 2002 16:38 EST
- in response to Edmond Hung
You could use a workflow-aware framework for your application.
JStateMachine (http://www.jstatemachine.org) is a good open source application framework that will help you deploy code on the server to ensure the flow you want is followed properly.
Setting expires and no-cache headings depends upon the browser behaving as it should... -
How to avoid user viewing the previous pages?[ Go to top ]
- Posted by: Edmond Hung
- Posted on: December 21 2002 08:26 EST
- in response to Brian OByrne
Setting expires and no-cache headings depends upon the >>browser behaving as it should...
So, how does it achieve it? Because the data is on the browser how can you prevent user pressing the "Backspace" which will go to the previous page in IE. -
How to avoid user viewing the previous pages?[ Go to top ]
- Posted by: Ferhat SAVCI
- Posted on: December 22 2002 15:01 EST
- in response to Edmond Hung
You cannot prevent the user from pressing backspace or the back button.
What you can do is detect when the user has gone backwards and do something about it. -
How to avoid user viewing the previous pages?[ Go to top ]
- Posted by: Brian OByrne
- Posted on: December 23 2002 07:59 EST
- in response to Edmond Hung
Edmond,
As Ferhart said, it makes it possible to detect when the user has used the back button and handle it easily.
For example: you could configure the workflow such that if an event arrived out of sequence the user would be brought to a page telling them that the back button shoud not be used, and given the option of starting the process again or continuing from where they left off.
Brian. -
How to avoid user viewing the previous pages?[ Go to top ]
- Posted by: Dave Hewitt
- Posted on: December 23 2002 05:24 EST
- in response to Edmond Hung
Use POST for navigation. When a page is returned as a result of a form POST submission, browsers will refuse to display it unless the original data is re-posted, and will prompt the user with a 'page has expired' message if they hit the 'back' button. -
This does not work in all cases[ Go to top ]
- Posted by: Parag Parashar
- Posted on: November 30 2004 00:21 EST
- in response to Edmond Hung
Hi,
We have included the code for page expiry, however we observe that it works in some cases and it does not work in some cases. Also is this code browser dependent.
Your feedback is highly apprecited.
Regards,
Parag