Springmvc中@RequestBody和@RequestParam能够同时使用吗

 @RequestMapping(value = "", method = RequestMethod.POST)

    public Result get(@RequestBody User user,

                      @RequestParam("username") String hehe) throws Exception {


}

如何能够接受user对象的同时,同时接受username?


假设User对象为


public class User  {


    private String id;


    private String username;


    private String email;


    private String phone;

}


繁华开满天机
浏览 7116回答 2
2回答

慕的地6264312

post http://url?username=123{    id: "",    username: "",    email: "",    phone: ""}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java