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.

How to do if-else in Thymeleaf?

What's the best way to do a simple if-else in Thymeleaf? I want to achieve in Thymeleaf the same effect …

java jsp if-statement jstl thymeleaf
How to avoid the "Circular view path" exception with Spring MVC test

I have the following code in one of my controllers: @Controller @RequestMapping("/preference") public class PreferenceController { @RequestMapping(method = RequestMethod.GET, …

spring spring-mvc circular-reference thymeleaf spring-mvc-test
Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers

This question has been asked before but I did not solve my problem and I getting some weird functionality. If …

spring-boot thymeleaf
Setting up a JavaScript variable from Spring model by using Thymeleaf

I am using Thymeleaf as template engine. How I pass a variable from Spring model to JavaScript variable? Spring-side: @RequestMapping(…

javascript spring thymeleaf
Using Thymeleaf when the value is null

I have some values in my database which can be null if they have not already been entered. But when …

html null thymeleaf
How to set thymeleaf th:field value from other variable

I have a simple text input field where i have to set default value from one object and save its …

html spring spring-mvc thymeleaf
Thymeleaf: how to use conditionals to dynamically add/remove a CSS class

By using Thymeleaf as template engine, is it possible to add/remove dynamically a CSS class to/from a simple …

java html css spring thymeleaf
Thymeleaf: Concatenation - Could not parse as expression

I'm having an issue when trying to concat multiple values in my template. According to Thymeleaf here I should simply …

java html thymeleaf
setting up a value for a variable name in thymeleaf

I am new to Thymeleaf and converting my Web page from JSP to Thymeleaf. I have a strut tag like …

java html spring jsp thymeleaf
Thymeleaf th:text - Put a text without removing HTML structures

I'm new in thymeleaf and I try to create a template. My problem is this code: CODE <h1 th:…

templates spring-mvc thymeleaf