Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

no matching editors or conversion strategy found

 
Ranch Hand
Posts: 43
  • 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: 24865
174
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: 43
  • 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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic