You can use the following example of JavaScript to skip over pages that you
don't want cached:

(See attached file: page3.html)(See attached file: page2.html)(See attached
file: page1.html)

Look for the line:

<A HREF="javascript:location.replace('page2.html')">Page 2</A>

I use it with the code you outlined to prevent caching of the JSP/Servlet pages and to 
prevent the error you are seeing.

HTH,
Greg.





Raja Periyasamy <[EMAIL PROTECTED]> on 2002/07/11 10:49:56 AM

Please respond to "JDJList" <[EMAIL PROTECTED]>

To:   "JDJList" <[EMAIL PROTECTED]>
cc:

Subject:  [jdjlist] Caching issue



I get 'Page has expired' warning when I use JavaScript
code 'window.history.back()'.

Here is the problem instance. All our JSP pages are
not cached. We have the following scriplet code in our
JSP pages :

     response.setHeader( "Cache-Control", "no-cache" );
     response.setDateHeader( "Expires", 0 );
     response.setHeader( "Pragma", "No-cache" );

We've a JSP page that shows a input form. Enter some
invalid data and submit to a servlet.  ( FORM action
is POST ). Error JSP page is displayed. Click on 'go
back' button on the error page. The link to the 'go
back' button is 'javascript:window.history.back()'.
This causes the 'Page has expired' warning page.

If I make that particular form JSP page cached, that
is comment the above lines, I get the form page with
previously entered values when I hit the 'go back'
button.

Is there any solution to go back to the form page
without getting the warning page and without making
that form JSP page cached, when I hit 'go back' button
on the error page?

Any help would be greatly appreciated.

Thank you.



__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm




Title: Untitled
Page 4
Title: Untitled
Page 3
Title: Untitled
Page 2
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to