Relative Content

Tag Archive for spring-bootthymeleaf

How do I fetch an API and display it on a custom Error 404 Page?

I’m trying to build a custom error 404 page that displays a random Chuck Norris joke on it, but even though typing in the wrong URL makes the error page show up, Thymeleaf doesn’t render the Chuck Norris joke. I tried troubleshooting it by replacing root.get("value").asText() with "Hello World!" as the second argument in model.addAttribute to make sure it was working, but it wasn’t rendered on the page either. Even attempting to debug the error method with System.out.Println hasn’t worked because nothing is printed to the terminal whenever a request is made to the error page. Just in case it’s relevant, I wrote server.error.whitelabel.enabled=false in application.properties to get rid of the WhiteLabel error page and display my custom error page instead.

Spring Boot Thymeleaf Modal Form Not Saving Data to Database

I’m working on a Spring Boot project with Thymeleaf where users can create appointments. The appointment creation form is in a modal popup, and users must be authenticated to access it. The form data is successfully sent to the controller, but the appointment is not being saved to the database.

Spring Boot + Thymeleaf, send multiple objects in form back to controller

I have a DTO with multiple objects in it, it is basically an ArrayList sent by the Spring Boot controller to the Thymeleaf template.
This list of objects needs to be sent back to the controller, but i am doing something wrong
This is my template code, i have made it much more short for readability because the real one is huge, i think this includes the important part: