开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜