我正在做一些春季表单验证,但是我得到了:
Failed to convert property value of type 'java.lang.String' to required type 'ja
va.util.Date' for property 'birthdate'; nested exception is java.lang.Illega
lStateException: Cannot convert value of type [java.lang.String] to required typ
e [java.util.Date] for property 'birthdate': no matching editors or conversi
on strategy found
但是,在我的 modelAttribute 表单中,我有:
@NotNull
@Past
@DateTimeFormat(style="S-")
private Date birthdate;
我认为 DateTimeFormat 对此负责?
我正在使用休眠验证器 4.0。