Win a copy of 97 Things Every Java Programmer Should Know 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

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: 4588
  • 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.
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic