This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Validation for Multiactioncontroller
 
Similar Threads
org.springframework.web.servlet.DispatcherServlet noHandlerFound
Spring 2.5 MultiActionController methodNameResolver not working
jsp error in spring
event handling for med sized MVC app
MultiActionController(Spring) for ActionDispatcher(Struts)