在核心控制器Controller加这个
@InitBinder
protected void initBinder(WebDataBinder binder) {SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
自动转换date类型的数据
在核心控制器Controller加这个
@InitBinder
protected void initBinder(WebDataBinder binder) {}
自动转换date类型的数据