Hello Jack!

Thursday, January 03, 2002, 8:08:04 PM, you wrote:

JX> I need some help on this problem:

JX> Consider the following scenario:

JX> Two pages: page A, and page B. page A has a link to page B.

JX> Page A uses:
JX> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
JX> response.setHeader("Pragma","no-cache"); //HTTP 1.0
JX> to expire the page once it is loaded in order to ensure the data display on the 
page A is up-to-date.

JX> the problem happends when there is a self-posting form on page A. If a self-post 
in commited before
JX> linking to page B, and from page B, user clicks on brower-provided Back button, 
he/she will get
JX> a "page has expired" error.

Is this problem related to the "Cache-Control: no-cache" and "Pragma: no-cache"?
If the page is generated by a result of submitting a POST form, then
the user goes to a new page by a link and presses back we'll get some
user-confusing message anyway, won't we?

JX> (it is not a big deal, since a simple refresh will solve it.
JX> However, it is still not preferable.)

JX> Cause of the problem: form data expired. Only occurs on IE.

JX> Any suggestions?

Not very sure, but maybe:

after you process the POST form reply with a redirect.

(To me it looks like it does not matter if the page that you redirect too
contains these caching-disabling directives or not -
if they are there and they work -
    (and I'm not sure they will, maybe "Expires: -1" would
     do a better job, please correct me if I'm wrong)
then the page will be automatically reloaded from the server
if they are not there or they do not work
then the browser-cached copy of the page will be displayed
)

Then pressing the 'Back' button will have no upleasant results.
--
Best regards,
 Anton                            mailto:[EMAIL PROTECTED]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to