将时间空字符串初始化 @InitBinder public void initBinder(WebDataBinder binder, WebRequest request) { //转换日期 DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // CustomDateEditor为自定义日期编辑器 binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); }