您必须在控制器中注册一个InitBinder,以便spring将日期字符串转换为java.util.Date对象并在command对象中进行设置。在您的控制器中包括以下内容:
@InitBinder public void initBinder(WebDataBinder binder) { SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy"); sdf.setLenient(true); binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true)); }使用以下命令修改您的jsp:
<input type="text" path="dueDate" class= "date" name = "dueDate" value = "<fmt:formatDate value="${cForm.dueDate}" pattern="MM-dd-yyyy" />"/>


