Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts 2 validation and prevent double submit

 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have the following code which allows a user to register. However the validation of the form fields do not work when the interceptors are present???

RegisterAgency.jsp



struts.xml


RegisterAgencyAction-validation.xml

 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you see here, then the basicStack doesn't have the validation interceptor. Try using the defaultStack instead in your action...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both the "validation" and "workflow" interceptors (or their equivalent) are required for the complete validation process--"validation" just calls validation, "workflow" redirects based on the presence (or lack thereof) of any errors.
 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys I have another issue. My package extends tiles-default as follows:

struts.xml


tiles.xml



RegisterAgency.jsp is as before

When the RegisterAgencyTile action is executed I get the following error:

 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone got an idea what the problem is here?
 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I remove



from my web.xml the RegisterAgency.jsp page is displayed correctly. But then I have the same problem as specified here http://www.coderanch.com/t/459786/Struts/container-managed-security-tiles. Any ideas?
 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have reworked my web.xml as follows and everything appears to be working now.



its one hell of a fudge and I'm still not sure why this issue was happening
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic