aspose file tools*
The moose likes Struts and the fly likes struts 2 validation and prevent double submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 validation and prevent double submit" Watch "struts 2 validation and prevent double submit" New topic
Author

struts 2 validation and prevent double submit

vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
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

Joined: Aug 03, 2008
Posts: 9305
    
  17

If you see here, then the basicStack doesn't have the validation interceptor. Try using the defaultStack instead in your action...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jul 31, 2009
Posts: 104
thanks
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
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

Joined: Jul 31, 2009
Posts: 104
Has anyone got an idea what the problem is here?
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
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

Joined: Jul 31, 2009
Posts: 104
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts 2 validation and prevent double submit