您的位置:首页 > 理论基础 > 计算机网络

页面使用时间插件导致http 400错误

2016-11-10 00:00 239 查看
页面使用jquery是采用了时间插件,后台采用的是springMVC,直接请求的时候会报400错误,这是因为没有使用时间格式转换,使用时间的时候可以使用如下的代码进行转换,格式需要根据页面格式来进行转换

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