Matt,

The example is a bit oblique to me and the Action classes JavaDoc doesn't
elaborate very well...

FWIW, I only see it used in EditRegistrationAction & SaveRegistrationAction
with very little commenting.  Is there a different example I shoud or
location I should be looking at?

However the code comment does say:
// Set a transactional control token to prevent double posting

Which is one of the things to look at in my evaluation because this was an
issue I've had to deal with in all of the Servlet/JSP solutions I've done...

Here is my guess as to what it does:

Use saveToken() to stash away a hashcode (in the sesssion) of the current
request.

Use isTokenValid() to see if the saved hashcode matches the current
request's hashcode... if so, this is a duplicate post so then the code
should somehow produce the same response as last time?  (I forget the math
term... but basically have f(x) = f(f(x)).)

Use resetToken() to remove the hashcode (from the session).  (If so, why
does it have a request parameter?)

Are my assumptions correct?

+= Jeff Knee

> -----Original Message-----
> From: Matt Raible [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 01, 2001 2:01 AM
> To: Struts Users Mailing List
> Subject: Re: Tokens
> 
> 
> see the example app - they're used to track if the form has 
> already been
> submitted and such (back button and reload button issues).
> 
> --- Stanley Struts <[EMAIL PROTECTED]> wrote:
> > Hi, what are tokens?  Do any of you have a link of a
> > page that discusses what are tokens and what is there
> > use?  Thanks! :)
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Buy the perfect holiday gifts at Yahoo! Shopping.
> > http://shopping.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Buy the perfect holiday gifts at Yahoo! Shopping.
> http://shopping.yahoo.com
> 
> --
> 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