see a good reference implementation in
David M. Geary's book "advanced Java Server Pages"


-----Original Message-----
From: Rob Breeds [mailto:[EMAIL PROTECTED]]
Sent: Montag, 26. November 2001 12:08
To: Struts Users Mailing List
Subject: Re: back button causes form resubmit


And the answer was...

use a transaction token! The archives REALLY are useful sometimes! :)

Rob





                    Rob
                    Breeds/UK/IBM@       To:     "Struts Users Mailing List"
<[EMAIL PROTECTED]>
                    IBMGB                cc:
                                         Subject:     back button causes
form resubmit
                    21/11/2001
                    11:40
                    Please respond
                    to "Struts
                    Users Mailing
                    List"







I have a form where the user can add and delete values in a collection (by
submitting the form with different params). When they are done
adding/deleting they can hit a 'save' button to invoke an action to save
the data to a database and display a results page.

But if the user hits the browser back button, the last action they invoked
on the data entry screen is invoked. If it was an add, another item is
added to the collection, which although wrong is harmless.

If it was a delete, then an exception array out of bounds is thrown because
the collection no longer contains the previously deleted value.

How can I prevent the user doing a double add/delete? Do I need to use a
transaction token?

Thanks

Rob Breeds




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





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


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

Reply via email to