springboot接受表单400错误

主要原因是封装的类型与表单传入的字段类型无法匹配

controller接受post方法,将字段封装成user,因此表单传入的类型必须完全匹配User中的字段类型

    @RequestMapping(value="/reg",method=RequestMethod.POST)
    public String reg(Model model,User user){
            ...
    }

 

posted @ 2018-06-23 10:17  逃跑旅馆  阅读(2006)  评论(0编辑  收藏  举报