Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Cannot insert data including date and image in Spring Boot in Thymleaf

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done some couple of exercise about Spring Boot with Thmeleaf as CRUD operation including uploading file , register date except for other things but there is a typo. I couldn't insert information in the database because of not uploading file and register date.

Can you check it if you don't mind. I'll appreciate you if you can help me solve it out.

Here is the error shown below.

Employee Class

Thymleaf Part

Controller Part

Posts: 4277
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the date, your parser is this:

but the error shows that the date given is this:
The formats do not match.

For the image, lines 10-16 are completely unnecessary, and simply don't do anything other than mess up your byte array.
You have the byte[] from line 8.
That's all you need.
Popeye has his spinach. I have this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!