这是因为提交表单中有DATE类型的数据,SPRING MVC知道如何处理,加上以下代码即可
/**
* springMvc绑定类型处理
* @author xh
* @param binder
*/
@InitBinder
protected void initBinder(WebDataBinder binder) {
//解除spring mvc list参数限制长度问题
binder.setAutoGrowCollectionLimit(1024);
binder.registerCustomEditor(Date.class,
new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
binder.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, true));
binder.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, true));
}