• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Validation for Multiactioncontroller

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know how struts works. I am trying to bind validators with spring mvc.
reply
    Bookmark Topic Watch Topic
  • New Topic