spring rest post?
@ModelAttribute("user")
@RequestMapping(value = "/", method = RequestMethod.POST)
public User saveUser( @RequestBody User user ) throws IOException {
logger.debug(user);
return user;
开发者_JAVA技巧}
requestbody will convert the json into bean(pojo), is there required to use annotation @ModelAttribute("user") in this case?
@ModelAttribute is not required in this case. For more information on this subject, please see Keith Donald's blog: Ajax Simplifications in Spring 3.0
精彩评论