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

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

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