Controller类里面:
@InitBinder
protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder) throws Exception {
// DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
CustomDateEditor dateEditor = new CustomDateEditor(format, true);
binder.registerCustomEditor(Date.class, dateEditor);
super.initBinder(request, binder);
}