Win a copy of Transfer Learning for Natural Language Processing (MEAP) 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

! Mapping error for springboot project

 
Ranch Hand
Posts: 77
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this error:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu May 21 18:43:48 CEST 2020
There was an unexpected error (type=Internal Server Error, status=500).
Error during execution of processor 'org.thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor' (template: "add-customer" - line 39, col 52)

I uploaded the project to github so it would be easier for you to find the problem .
It works fine until I get to the http://localhost:8080/new and then it crashes.
github
 
Sheriff
Posts: 21919
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To control over how errors are handled, I suggest you take a look at https://www.baeldung.com/spring-boot-custom-error-page.

However, I'd say the more pressing concern is the actual error. There's apparently something going wrong in your 'add-customer.htm' Thymeleaf template, on line 39, column 52. The logs should show you more information, but that's where you now need to focus on first.
 
Ranch Hand
Posts: 1871
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You need a setter for the SSN in your Customer. Also, I need to change SSN type from Double to String
Also, you need to fix the spelling the CityOfResidence:


But one thing is the update customer does not update anything. I need some help to figure out way.
 
Himai Minh
Ranch Hand
Posts: 1871
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more fix for your UpdateUser:


The reason for the changes:
Binding Result always return an error in the original code because your customer in the update form does not have city of residence, ssn, country of residence , gender. It always returns binding result error.
It is a validation error.
In this case, we don't really need to validate.
And in this new method, we should pass the a customer model attribute to the Thymleaf form. The customer has updated/same email, name, surname. Then, save the updated information.
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic