在controller加入下面代码
@InitBinder
public void bindingPreparation(WebDataBinder binder) {
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
CustomDateEditor orderDateEditor = new CustomDateEditor(dateFormat, true);
binder.registerCustomEditor(Date.class, orderDateEditor);
}