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));

}

猜你喜欢

转载自www.cnblogs.com/y1995/p/9119759.html