springMVC 接受对象 The request sent by the client was syntactically incorrect.
2017-06-03 15:39
281 查看
在接受对象的时候,The request sent by the client was syntactically incorrect.
在接受对象里有个date类,如要date的时候,与springMVC中的机制不相符
在controller类中加入这个。
或者在model类中
在接受对象里有个date类,如要date的时候,与springMVC中的机制不相符
在controller类中加入这个。
@InitBinder public void InitBinder(ServletRequestDataBinder binder){ // 自动转换日期类型的字段格式 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true)); }
或者在model类中
@DateTimeFormat(pattern="yyyy-MM-dd") private Date createDate; // 建馆时间
相关文章推荐
- springmvc 上传文件的时候.The request sent by the client was syntactically incorrect
- SpringMVC 表单提交参数不匹配报错 提交表单报400错:description The request sent by the client was syntactically incorrect.
- springMVC 页面填写日期运行时发生异常!The request sent by the client was syntactically incorrect
- springMVC日期转换及The request sent by the client was syntactically incorrect.解决办法
- SpringMVC---400错误The request sent by the client was syntactically incorrect ()
- springMVC日期转换及The request sent by the client was syntactically incorrect.解决办法
- Springmvc注解开发:日期类型参数封装报错:The request sent by the client was syntactically incorrect.
- SpringMVC---400错误The request sent by the client was syntactically incorrect ()
- 解决SpringMVC入参出现The request sent by the client was syntactically incorrect请求语法错误方法
- springmvc提交表单,格式问题:The request sent by the client was syntactically incorrect.
- springmvc报错:The request sent by the client was syntactically incorrect
- springMVC报出400,The request sent by the client was syntactically incorrect.
- SpringMVC 出现"The request sent by the client was syntactically incorrect ()"解决办法
- SpringMVC-使用converter转换器解决后台接收Date格式数据时The request sent by the client was syntactically incorrect ()
- The request sent by the client was syntactically incorrect-SpringMVC问题详解
- 解决 spring mvc3.1下post json出现HTTP Status 400 The request sent by the client was syntactically incorrect
- spring mvc 400,The request sent by the client was syntactically incorrect的问题
- 服务器,tomcat,网页请求错误400,The request sent by the client was syntactically incorrect的问题
- 400 Bad Request The request sent by the client was syntactically incorrect ().
- Spring MVC "The request sent by the client was syntactically incorrect ()"解决办法