Questions tagged [thymeleaf]

Thymeleaf is an XML/XHTML/HTML5 template engine (extensible to other formats) that can work both in web and non-web environments. It is better suited for serving XHTML/HTML5 at the view layer of web applications, it can process any XML file even in offline environments. It provides an optional module for integration with Spring MVC, so that you can use it as a complete substitute of JSP in your applications made with this technology, even with HTML5.

Thymeleaf is an XML/XHTML/HTML5 template engine (extensible to other formats) that can work both in web and non-web environments. It is better suited for serving XHTML/HTML5 at the view layer of web applications, but it can process any XML file even in offline environments.

It provides an optional module for integration with Spring MVC, so that you can use it as a complete substitute of JSP in your applications made with this technology, even with HTML5.

Unlike JSP, Thymeleaf is a natural template engine meaning that the file could be directly opened in browsers without having to run the application.

The main goal of Thymeleaf is to provide an elegant and well-formed way of creating templates, allowing to use them also as static prototypes.

Its architecture allows a fast processing of templates, relying on intelligent caching of parsed files in order to use the least possible amount of I/O operations during execution.

Thymeleaf is a Java library.

Additional Thymeleaf Resources:

Resources for Spring Integration:

9206 questions
2
votes
1 answer

Boolean attribute not binding in Thymeleaf

I am trying to get my checkbox marked by setting an attribute of a model to true, but it does not get checked. This is my checkbox:
blaa
  • 801
  • 3
  • 16
  • 32
2
votes
1 answer

Property or field 'isLPG' cannot be found on object of type 'com.rentautosofia.rentacar.bindingModel.CarBindingModel' - maybe not public?

I have an MVC logic like this one. CarBindingModel package com.rentautosofia.rentacar.bindingModel import javax.validation.constraints.Size class CarBindingModel(@Size(min = 1) var name: String = "", …
Dennis Barzanoff
  • 363
  • 10
  • 16
2
votes
2 answers

Spring thymeleaf MVC form does not fill object fields

I have a problem with retrieving values from a thymeleaf form in a Spring MVC app. This app has multiple forms, and all but one work fine. The failing one is slightly different in that it has a dropdown that is fed from a list of objects. The UI…
IndyStef
  • 747
  • 1
  • 6
  • 15
2
votes
1 answer

How can you build an absolute URL in thymeleaf?

I would like to display an absolute url generated at run-time with a parameter. Not create a href to a page but display the URL using th:text. Any simple way to do this with Tymeleaf (without having to concatenate the URL pieces from #request object…
wi2ard
  • 1,471
  • 13
  • 24
2
votes
1 answer

styles not applied on validation form using thymeleaf and bootstrap

Trying to add text with a style on error validation in a bootstrap form This is part of the form:
davisoski
  • 727
  • 2
  • 14
  • 41
2
votes
2 answers

Thymeleaf unable to load static resources

I have a spring web application that loads the templates correctly, but does not load static assets like CSS and images. I have added my static resources within the src/main/resources/static directory, added thymeleaf annotations, added…
Robert Valencia
  • 1,752
  • 4
  • 20
  • 36
2
votes
1 answer

Form submission with Java and Thymeleaf

I am creating my first form with Java developing with Sprint Tool Suite on my local machine. I created an index.html page with a simple form with 3 input fields. I want to have the form submit to a results.html page which just displays the values…
Jonathan Small
  • 1,027
  • 3
  • 18
  • 40
2
votes
0 answers

Updating web UI from Spring

I'm using Spring Boot and Thymeleaf and I'm a bit confused about finding best solution. On back-end side, I got sheduled function that is sheduled several times a day, and each time it updates my Boolean success; flag to true if everything went…
user9309329
  • 313
  • 3
  • 13
2
votes
0 answers

Thymeleaf th:each attribute failed on form element

I find Thymeleaf th:each is not working properly on
element when ${items} is empty. Hello…
Raymond
  • 885
  • 10
  • 28
2
votes
1 answer

Thymeleaf - Image to act as Hyperlink

Using Thymeleaf, how can I make an image act as a hyperlink? The Thymeleaf Documentation says nothing about images and I tried using standard HTML for this issue but none of the below attempts made my image an active hyperlink.
ceid-vg
  • 323
  • 2
  • 9
  • 21
2
votes
0 answers

Dropdown rendered with jquery is blocked (users unable to select an option)

I'm using Spring and thymeleaf to make a little web page with a form. There is a table below in which a td with a field must display a dropdown list loaded from elsewhere with ajax. The dropdown is displayed but the user can't choose an option as it…
ffuentes
  • 1,042
  • 5
  • 16
  • 36
2
votes
1 answer

Spring Boot: process a html file with thymeleaf without controller

I would like to serve internationalized html pages with my Spring Boot application and I am using Thymeleaf with messages_XX.properties for i18n. I would prefer accessing these as http://localhost:8080/some/path/test.html and having them in e.g.…
HingeSight
  • 400
  • 5
  • 13
2
votes
1 answer

Thymeleaf external javascript file shares the module attributes with html file

Let's say you have a HTML5 template file which includes an external javascript file. for example: Reading List
Kim Huang
  • 53
  • 1
  • 5
2
votes
1 answer

Using Thymeleaf with Google charts and Java Map

The Thymeleaf block I have made in JavaScript cuts off the ending ; of the variable, and throws an Uncaught (in promise) SyntaxError: Unexpected token ' in JSON at position 2. The code does parse like it should, except for the data variable. Parsed…
2
votes
1 answer

Spring Boot - Image assets are not being loaded even if they are permitted on WebSecurityConfig file

I have recently wanted to add some image on a page within my Spring Boot application, templated with Thymeleaf. Even other assets (js, css) are being loaded and served successfully, images inside permitted img folder is not being served, a broken…
1 2 3
99
100