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.

You just need to decide what is more important for you: to solve the
culprit of double submit, or to detect and handle it.

Michael.

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

Reply via email to