When using spring's @datetimeformat to format the date type, an error occurs:
Org.springframework.validation.bindexception:org.springframework.validation.beanpropertybindingresult:1 errors
Field error in object ' Modelinfoexample ' on field ' birthday ':
Rejected value [2014-12-09];
codes [Typemismatch.modelinfoexample.birthday,typemismatch.birthday,typemismatch.java.util.date,typemismatch];
arguments [org.springframework.context.support.DefaultMessageSourceResolvable:
codes [Modelinfoexample.birthday,birthday]; arguments []; Default message [birthday]];
Default message [Failed to convert property value of type ' java.lang.String ' to required type ' java.util.Date '
For the property ' birthday '; Nested exception is org.springframework.core.convert.ConversionFailedException:
Failed to convert from type java.lang.String to type @org. Springframework.format.annotation.DateTimeFormat
Java.util.Date for value ' 2014-12-09 '; Nested exception is
Java.lang.IllegalStateException:JodaTime Library not available-@DateTimeFormat not supported]
Obviously, it is true that the Jodatime library, which joins its dependencies in Pom.xml, is done:
<dependency><groupId>joda-time</groupId><artifactId>joda-time</artifactId>< Version>2.6</version></dependency>
Jodatime Library not available-@DateTimeFormat not supported