posted 1 year ago
I am using Spring MVC using Model obect SchoolForm.
Declared list of Student objects in the model SchoolForm.
I declared dateOfBirth field as java.util.Date object.
After submit i am getting the following error.
dateOfBirth field i am entering date in the format dd.mm.yyyy.
But getting the following error any idea how to resolve the following issue.
Field error in object 'schoolForm' on field 'student[0].dateOfBirth': rejected value [12.12. 1986]; codes
[typeMismatch.schoolForm.student [0].dateOfBirth, typeMismatch.schoolForm.student.dateOfBirth, typeMismatch.student[0].dateOfBirth, typeMismatch.student.dateOfBirth, typeMismatch.dateOfBirth, typeMismatch.java.util.Date
typeMismatch] ; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes
[schoolForm.student[0].dateOfBirth, student[0].dateOfBirth] ; arguments [ ] ; default message
[student[0].dateOfBirth]]; default message [Failed to convert property value of type 'jaya.lang.String'
to required type 'java.util.Date' for property 'student[0].dateOfBirth' ; nested exception is
java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type
'java.util.Date' for property 'dateOfBirth' : no matching editors or conversion strategy found]
SpringError.JPG