In Spring MVC (with Spring MVC 2.5+ annotation based configuration), it looks exactly the same:
@RequestMapping(method = RequestMethod.POST) public ModelAndView edit(User u) { ... }
The User object will be automatically populated. You can also explicitly specify the name of the corresponding model attribute using the @ModelAttribute annotation (by default, the attribute name is the name of the argument class with the decapitalized first letter, that is, "user")
... (@ModelAttrbiute("u") User u) ...
source share