aspose file tools*
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
Author

Validation for Multiactioncontroller

Jerry Yan
Greenhorn

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?

Thanks.
eshu khare
Ranch Hand

Joined: Aug 01, 2008
Posts: 44
Hi,
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
Greenhorn

Joined: Feb 13, 2009
Posts: 2
I know how struts works. I am trying to bind validators with spring mvc.
 
jQuery in Action, 2nd edition
 
subject: Validation for Multiactioncontroller