Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts: Duplicate Form Submission Handling

 
Matt Connors
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to properly handle duplicate form submission in my Struts application. In my .jsp I put the following hidden field:

<html:hidden property="org.apache.struts.taglib.html.TOKEN" />

and I receive the this error message:

"javax.servlet.jsp.JspException: No getter method for property org.apache.struts.taglib.html.TOKEN of bean org.apache.struts.taglib.html.BEAN"

Can someone tell me what I'm doing wrong? Is there a different way to set up this hidden field?

Thanks in Advance,
Matt
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts handles this automatically. You do not need to add the html:hidden tag.

If you've html:form on the jsp and a previous action did saveToken(request); it will slip the hidden field in right after the opening form html tag.
 
Matt Connors
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct - thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic