You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mister Hundy <mr...@hotmail.com> on 2002/02/01 17:30:19 UTC

Re: Transactional Control Tokens?

It prevents an erroneous double submit.  If your users use the back button 
or click submit twice the isTokenValid() will return false since the token 
was reset on the original call.

>In the struts-example application in (SaveRegistrationAction.java:190, 
>:161)
>the author calls the method saveToken(request) and then isTokenValid() and
>resetToken(). What does this use of transactional control tokens provide?
>
>
>--
>To unsubscribe, e-mail:   
><ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Transactional Control Tokens?

Posted by Greg Hess <gh...@wrappedapps.com>.
Ok,

Now that I understand the problem, I am trying to understand how the token
is to be used. I have a some questions...

1) Are transactional tokens automatically set by the Action class on submit
or do I call the generateToken()?
2) Does the Action class know when a double submit occurs and then sets the
valid flag to false?
3) To use this token do I just test at the beginning of my Action perform()
for a valid token if it is not valid then do not perform any other business
and record an error and return to the input page?
4) If the token represents an instance of a client request and I have
encountered a invalid token and am returning the client to the input page is
resetToken(request) just house cleaning before the object is destroyed?
Because wouldn't the input page submition generate a new transaction token
for the next request?
5) Is the problem associated with a double submit only that I would execute
the same code twice and for example if I was recording the number of page
requests I would not want to record double submits? or does it have other
implications?

Thanks for the help
Greg


-----Original Message-----
From: Mister Hundy [mailto:mr_hundy@hotmail.com]
Sent: Friday, February 01, 2002 11:30 AM
To: struts-user@jakarta.apache.org
Subject: Re: Transactional Control Tokens?


It prevents an erroneous double submit.  If your users use the back button
or click submit twice the isTokenValid() will return false since the token
was reset on the original call.

>In the struts-example application in (SaveRegistrationAction.java:190,
>:161)
>the author calls the method saveToken(request) and then isTokenValid() and
>resetToken(). What does this use of transactional control tokens provide?
>
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>