Skip to content
Advertisement

Tag: thymeleaf

Thymeleaf cannot detect templates inside spring-boot project

I have the following project structure in my Spring boot app, in which I want to use Thymeleaf but the spring-boot cannot find my template directory and is showing warning Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration) PS: I am using @EnableAutoConfiguration In my controller code I am doing something like: and index.html

Thymeleaf Neither BindingResult nor plain target object for bean name ‘person’ available as request attribute

From what I can tell this is set up correctly but I am getting the following error: Form Person.java Controller I looked at Spring-boot and Thmeleaf setup and it looks like my setup is identical. ——————— Update 1 ———————– I have changed my post method to include BindingResult with no success. Answer You forgot to add BindingResult after your @ModelAttribute

Serving HTML pages in a Spring Boot application

I have a Spring Boot Application. I am trying to pass a variable to a HTML page but unfortunately I cannot seem to do it, on application start nothing is rendered except the static text: “WORLD”. My controller is as below: And my index.html: I was looking for an answer and I found these articles: How to serve .html files

How to send email with inline image using ThymeLeaf

I’m trying to send an email with an inline image using ThymeLeaf and Spring, but so far no success. The email sends, but the inline image won’t show in the email. The project is not web-based (not a website), but is a desktop stand-alone, not mobile This is how I get the image file: My service class: The HTML: Answer

SpringBoot with Thymeleaf – css not found

First to say is that I’ve been searching for a solution for a while now and I’m quite desperate now. I cannot get the css file to be accessible from html page when run by Spring Boot. html.file Application.java folder structure: I’ve tried putting the css folder into a static folder and/or removing the addResourcesHandlers, referencing to the css by

How to pass two objects to use in a form using thymeleaf?

My problem is the following : I’ve 2 differents objects that I’ve to fill from a single form. With 1 object, I simply do in the newFoo.html: and in the FooController: Let’s say I’ve an other object bar with a “status” variable in it. How can I do to pass that object so I can submit the input within the

Thymeleaf: how to get URL attribute value

I can’t find any solution for getting attribute from URL using Thymeleaf. For example, for URL: I need to get “error” attribute value. Also I’m using SpringMVC, if it could be helpful. Answer After some investigation I found that it was Spring EL issue actually. So complete answer with null checking is:

Advertisement