This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How token works in struts

 
kundanyasutech kundanyasutech
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic