Announcement Announcement Module
Collapse
No announcement yet.
Is Spring 3 @RequestMapping supposed to auto-bind request parameters? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is Spring 3 @RequestMapping supposed to auto-bind request parameters?

    I posted a question to StackOverflow a few weeks back that didn't get any responses, curious if anyone here might be able to shed some light on my question:

    http://stackoverflow.com/questions/9...est-parameters

  • #2
    You can use any arbitrary object and spring will bind parameters to properties that match.

    If you would have a method annotated with @ModelAttribute and use @ModelAttribute in your method the object return from the method annotated with @ModelAttribute would be used, if you leave out the @ModelAttribute on the method you would get a new object and not the contructed object. Next to that a @ModelAttribute can be @Valid any other object will not be validated.

    Next to that it is also documentation you now have in your method which object is used as @ModelAttribute.

    Comment

    Working...
    X