This week's book giveaway is in the Spring forum.
We're giving away four copies of Java Persistence with Spring Data and Hibernate and have Cătălin Tudose on-line!
See this thread for details.
Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

no matching editors or conversion strategy found

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
[Thumbnail for SpringError.JPG]
 
Saloon Keeper
Posts: 26728
190
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably want this: https://www.baeldung.com/spring-date-parameters
 
mohana krishna
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim Holloway,
Thanks for your reply.
Regards,
Mohan.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic