struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: Beating the REFRESH button.
Date Mon, 19 Aug 2002 14:35:23 GMT
Try changing the forward to your in the struts-config to have
This should result in refresh refreshing the url you end up at rather than

<forward  name="mysteryMachine" path="/" redirect="true"/>

(nb: redirecting this way will result in no parameters that were submitted
to being passed back to, which could be a very bad thing
depending on what you are doing (or it could be a good thing))

-----Original Message-----
From: Ray []
Sent: Monday, August 19, 2002 22:11
Subject: Beating the REFRESH button.

Hello there again.

I have a small problem with users hitting the refresh button whilst doing
things with my application. Here's the scenario:

User accesses - an action which displays a list of data items,
along with buttons to add, delete and edit data.  If the add information,
and it is validated as correct, then the data is written to the database
with the action, and the struts-config.xml redirects back to to display the new list.

The problem is that the last thing in the browser's URL window, is
(I imagine because servlet redirection does not update the browser's
history list); so if the user hits refresh, the action is
executed again.

Is there a tried and tested way to prevent this sort of thing happening.
I'm thinking that I could call a plain HTML file that calls up
from JavaScript; that way, it will be written into the browser's history

Would that be the best way to go about it, or does someone have a tidier
suggestion ... ? ... :-)

Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message