File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Validation for Multiactioncontroller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Validation for Multiactioncontroller" Watch "Validation for Multiactioncontroller" New topic

Validation for Multiactioncontroller

Jerry Yan

Joined: Feb 13, 2009
Posts: 2
My friends,

Need some help for multiactioncontroller of spring mvc.

I understand that MultiActionController supports multiple action methods which can be mapped using methodNameResolver. With different coming URL, it calls different method of the controller.

My question is regarding the validation. Are all methods of the controller sharing a single validator?

Is there a way to support different validators for different method name?

e.g., In a standard CRUD operation of an business object, edit/create requires firstname and lastname not empty, while delete requires only userid not empty. How do I implement in this way?

eshu khare
Ranch Hand

Joined: Aug 01, 2008
Posts: 44
If it is about struts validation then it is very simple to fix up, just set your action attribute validation as true or false while mapping and set the properties validation in the validation XML with respect to forms.
Please correct me if somewhere I have stated anything incorrect.

Thanks & Regards
Eshu Khare
Jerry Yan

Joined: Feb 13, 2009
Posts: 2
I know how struts works. I am trying to bind validators with spring mvc.
I agree. Here's the link:
subject: Validation for Multiactioncontroller
It's not a secret anymore!