Top "Thymeleaf" questions

Thymeleaf is an XML/XHTML/HTML5 template engine (extensible to other formats) that can work both in web and non-web environments.

Inserting an image from local directory in thymeleaf spring framework (with maven)

I have developed a project using this link: https://spring.io/guides/gs/serving-web-content/ I used maven to develop above …

html spring maven thymeleaf
Thymeleaf construct URL with variable

I have the following code setting a variable in my controller: model.set("type", type); In the thymeleaf view I …

java jsp thymeleaf
using data-* attribute with thymeleaf

Can I set data-* attribute with thymeleaf? As I understood from thymeleaf documentation I tried: <div th:data-el_id="${…

html thymeleaf
Spring Boot and custom 404 error page

In my Spring Boot application, I'm trying to configure custom error pages, for example for 404, I have added a following …

java spring spring-mvc spring-boot thymeleaf
How to check if list is empty using thymeleaf?

<div th:if="${tblUserList != null}"> --content-- </div> The above thymeleaf code is not working, where tblUserList …

html thymeleaf
How to have multiple condition in an th:if tag using thymeleaf

I have a text to render in three different possible colors using thymeleaf. So the code I've made so far …

java html spring jstl thymeleaf
For each operator in Thymeleaf

I can not find syntax for building simple for-each-loop in Thymeleaf template. I'm not satisfied with just th:each="" attribute, …

spring spring-mvc for-loop foreach thymeleaf
Thymeleaf - How to loop a list by index

How can I loop by index? Foo.java public Foo { private List<String> tasks; ... } index.html <p&…

java jakarta-ee thymeleaf each
How to bind an object list with thymeleaf?

I am having a lot of difficulty with POSTing back a form to the controller, which should contain simply an …

java spring spring-mvc spring-boot thymeleaf
Thymeleaf: check if a variable is defined

How can I check if a variable is defined in Thymeleaf? Something like this in Javascript: if (typeof variable !== 'undefined') { } …

java spring spring-mvc spring-boot thymeleaf