Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Mapping error for springboot project

 
Ranch Hand
Posts: 87
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: 21974
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.
 
Bartender
Posts: 1925
13
  • Likes 1
  • 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
Bartender
Posts: 1925
13
  • Likes 1
  • 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.
 
martin codey
Ranch Hand
Posts: 87
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Himai Minh wrote: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.




Thank you so much. It really worked.
 
The moth suit and wings road is much more exciting than taxes. Or this 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
    Bookmark Topic Watch Topic
  • New Topic