GeeCON Prague 2014*
The moose likes Struts and the fly likes How token works in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How token works in struts" Watch "How token works in struts" New topic
Author

How token works in struts

kundanyasutech kundanyasutech
Greenhorn

Joined: Sep 09, 2005
Posts: 1
Hi guys,

can anyone explain me how
isTokenValid(javax.servlet.http.HttpServletRequest request)
and
saveToken(javax.servlet.http.HttpServletRequest request)
works in struts.

Thanks,
kundan
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

When saveToken() is called, a hidden field will automatically be added to forms in your jsps (assuming you use html:form). The Struts servlet stores [in session] the most recent token.

isTokenValid() checks to see if the hidden variable submitted with the form matches the most recent one set through the saveToken method.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How token works in struts