You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andy wix <st...@hotmail.com> on 2004/10/04 15:18:20 UTC

Re: back button

Hi,

I have the following on the view page so I don't think I'm seeing the cached 
version of the page:

response.setHeader("Cache-Control","no-cache"); // HTTP 1.1
response.setHeader("Pragma","no-cache"); // HTTP 1.0
response.setDateHeader ("Expires", -1); // Prevents caching at a proxy 
server

All the view action does is set the token to prevent a delete operation 
being repeated in the event of a user hitting the browser's refresh button.

So the delete action deletes the contact from the db then deletes it from 
the arraylist stored in the session.
The view.jsp merely outputs what it finds in the arraylist.  The delete 
itself does work, so I just wonder what happens behind the scenes when the 
refresh is hit.

I note the point about application scope , but in my case the app is just a 
thin client for local configuration and there will only be 1 user at a time.

Regards,
Andy

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: back button

Posted by Jeff Beal <jb...@webmedx.com>.
andy wix wrote:
> Hi,
> 
> I have the following on the view page so I don't think I'm seeing the 
> cached version of the page:
> 
> response.setHeader("Cache-Control","no-cache"); // HTTP 1.1
> response.setHeader("Pragma","no-cache"); // HTTP 1.0
> response.setDateHeader ("Expires", -1); // Prevents caching at a proxy 
> server
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today! 
> http://www.msn.co.uk/messenger

Have a look at Section 13.13 of RFC 2616 
(http://www.ietf.org/rfc/rfc2616.txt).  It makes a distinction between 
caching mechanisms and history mechanisms.  The header fields you are 
setting are all related to caching.  The back button is a history 
mechanism.  The RFC states, "... a history mechanism is meant to show 
exactly what the user saw at the time when the resource was retrieved."

As I read this, if your browser is correctly implementing this RFC, 
using the back button will not re-issue a request to the server and you 
will see exactly what you saw last time.

-- Jeff