您的位置:首页 > 编程语言 > Java开发

SpringMVC 出现"The request sent by the client was syntactically incorrect ()"解决办法

2017-07-12 11:02 609 查看
问题描述:



原因:

Spring在转换日期出错

解决方法:

在Controller中添加

@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐