On 12/5/05, Nicolas De Loof <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I'm using token to avoid multiple submits in this flow :
>
> "/commande.do" creates an empty form-bean, saves a token and forwards to
> "tile:commande.new"
> "/commande/create.do" checks for token and creates datas in the database.
>
> If an exception occurs, an exceptionHandler is used to display an error
> message. I'm using it to catch Data integrity exception when user try to
> create an allready-existing entry. In this case, no token is saved
> anymore and user cannot change it's input and resubmit.
>
> How can I setup struts to have a new token beeing saved when an
> exception occurs, to allow the user to correct the form and submit ?
>
> Nico.

Are you sure you want to use tokens? Why not just use database? Enter
new data, INSERT to database, get SQLException, redisplay the form,
INSERT to database, all OK, display success page. Now when a user goes
back and submits the form again, you INSERT to database and get
duplicate key exception. No tokens needed, imho.

Michael.

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

Reply via email to