java web页面的input框输入时间显示400错误

Posted y1995

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java web页面的input框输入时间显示400错误相关的知识,希望对你有一定的参考价值。

在controller层初始化initBinder。

@InitBinder

public void initBinder(WebDataBinder binder) {

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

dateFormat.setLenient(false);

binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));

}



以上是关于java web页面的input框输入时间显示400错误的主要内容,如果未能解决你的问题,请参考以下文章