在Spring验证期间包装PropertyEdtior异常

在Spring验证期间包装PropertyEdtior异常,spring,spring-mvc,Spring,Spring Mvc,当我提交Spring表单且PropertyEditor无法转换值时,会引发异常,类似这样的消息会出现在我的validator errors对象中: Failed to convert property value of type java.lang.String to required type org.joda.time.DateMidnight for property startDate; nested exception is java.lang.IllegalArgumentExcep

当我提交Spring表单且PropertyEditor无法转换值时,会引发异常,类似这样的消息会出现在我的validator errors对象中:

Failed to convert property value of type java.lang.String to required type
org.joda.time.DateMidnight for property startDate; nested exception is
java.lang.IllegalArgumentException: Invalid format: "2010-111" is malformed at "1"
我能把它包装起来,在屏幕上显示一条更友好的信息吗

我在我的控制器中使用@Valid,表单中包含以下内容:

@NotNull
protected DateMidnight startDate;

谢谢

此错误消息包含消息代码,例如
类型不匹配.objectName.startDate
(请参阅)。要显示用户友好的消息,您需要使用相应的消息。

这里的问题是,在调用
@Valid
内容之前,属性编辑器拒绝输入方式,因此验证API是不相关的。这对你没有任何帮助。。。。