【问题标题】:spring rest post?春季休息站?
【发布时间】:2010-12-04 16:09:06
【问题描述】:
@ModelAttribute("user")
@RequestMapping(value = "/", method = RequestMethod.POST)
public User saveUser( @RequestBody User user ) throws IOException {
        logger.debug(user);
        return user;
}

requestbody会将json转成bean(pojo),这种情况下是否需要使用注解@ModelAttribute("user")?

【问题讨论】:

    标签: java spring rest restful-url


    【解决方案1】:

    在这种情况下不需要@ModelAttribute。有关此主题的更多信息,请参阅 Keith Donald 的博客:Ajax Simplifications in Spring 3.0

    【讨论】:

      猜你喜欢
      • 2013-03-23
      • 2015-03-15
      • 1970-01-01
      • 1970-01-01
      • 2016-01-30
      • 2013-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多