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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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

 
Greenhorn
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




application.properties






 
Rancher
Posts: 4277
47
  • 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:
2019-09-11
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)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!