At 10:35 AM -0700 5/11/05, Michael Jouravlev wrote:
On 5/11/05, Scott Purcell <[EMAIL PROTECTED]> wrote:
I am having trouble getting information, or a workaround for the following problem.

A user fills out a simple textfield form. I update the database with the value and show a new jsp page. Then the user hits the back-button, and even though the browser gives an alert (this will POSTDATA that is expired as cache") yes or no? And they say yes, I enter another record into my database. Causing problems.

I have my nocache set to true in my struts-config.xml. Any other ideas, solutions to this problem?

 Thanks,
 Scott

If you are looking how to detect double submit, then use tokens. If you want to get rid from double submits and from POSTDATA dialog, use redirection.

To use redirection, submit your data with POST, process it, then
redirect to the result page. User will be able to reload it without
causing a resubmit. Of course, you would need to save the data and
messages somewhere between requests, either in the session or you can
stuff then into request as a bunch of query parameters.

Michael:

In Scott's case, the user is hitting the back button, not reloading the result page. I think that even using your redirect strategy, there is no protection against the user navigating back and resubmitting a form, isn't that right?

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to