Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Validation for Multiactioncontroller  RSS feed

 
Jerry Yan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jerry Yan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how struts works. I am trying to bind validators with spring mvc.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!