为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

繁华开满天机 2019-03-23 19:14:55
 @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;}

2 回答

?
慕的地6264312

TA贡献1817条经验 获得超6个赞

post http://url?username=123

{

    id: "",

    username: "",

    email: "",

    phone: ""

}


查看完整回答
反对 回复 2019-04-18

添加回答

代码语言

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号