在Controller里加上这段代码
@InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(Date.class, new PropertyEditorSupport() { public void setAsText(String value) { try { SimpleDateFormat dateFormat = new SimpleDateFormat('yyyy-MM-dd'); setValue(dateFormat.parse(value)); } catch(ParseException e) { setValue(null); } } public String getAsText() { return new SimpleDateFormat('yyyy-MM-dd').format((Date) getValue()); } }); }