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

Thymeleaf - Context-relative and slash ending url

X When I access /admin: The url become delete?id= But when I access /admin/: The url become admin/delete?id= (that is the one I want) So should I use Server-relative URL as an alternative in this case, or…
user2477
  • 896
  • 2
  • 10
  • 23
2
votes
0 answers

Spring Boot + Thymeleafe + Vue.js multiproject

I'm new with Spring Boot and I have a problem with structure and settings for my project. I want to create project with several separate modules, like on image below. One of them ("vue") is for front-end and it will contain HTML, CSS and JS files.…
2
votes
1 answer

thymeleaf vs thymeleaf-spring4 dependency

Question is simple, what is the difference between the above dependencies? Does the first one enough for a springboot app or the second contains something special?
Zoltan
  • 162
  • 1
  • 14
2
votes
3 answers

Spring security login error "Request method 'POST' not supported"

I've looked at every related question I could find, but haven't been able to find an answer that works in my scenario. I'm using a Spring WebSecurityConfigurerAdapter, and I was able to authenticate a single user type, but after configuring my…
CBruenger
  • 57
  • 2
  • 8
2
votes
1 answer

Spring Boot Application Deployment issue on Weblogic

I have a Spring boot application that uses Thymeleaf as a template engine, I added a default controller that should redirects to Home page when deploying on server, Controller code snippet below: @Controller public class HomeController { …
Cypher
  • 71
  • 6
2
votes
1 answer

Create dynamic List Object in thymeleaf by Adding rows to Table

Here is my Code Sample with Controller. Controller class import java.util.ArrayList; import org.CodeDaemons.dao.Document; import org.CodeDaemons.dao.Documents; import org.springframework.stereotype.Controller; import…
Manoj Sharma
  • 1,068
  • 2
  • 11
  • 17
2
votes
2 answers

spring thymeleaf Sort enum alphbetically

I have an enum: public static enum States { SEL("Selangor"), WP("Wilayah Persekutuan"), KEL("Kelantan"), LAB("Labuan"), PER("Perlis"); private String value; States(String val) { this.value = val ; …
user4752891
2
votes
1 answer

Current logged in user is returning Null even though it displays current user information

In my Spring project I can register users and display the current users information however in my console the current user is returning null even though it is finding it in the database and displaying the users details. I can add a subject object to…
Jill
  • 431
  • 4
  • 13
  • 33
2
votes
2 answers

Using a fragment as a Thymeleaf variable to th:with and a th:data-content attribute

I'm looking to do something like the following. Is this possible or is there a workaround? myFragment.html
Some popover strings with some business logic [object…
riddle_me_this
  • 8,575
  • 10
  • 55
  • 80
2
votes
0 answers

Two object in one form binding

How obtain value of hotel in Controller ? now i have only null. The nested object are not allowed because of html 5 doesn't let to be nested. I have objects in template but only object knight bring the value and I need also further written controls…
2
votes
1 answer

Replacing existing div with content of fragment div using Thymeleaf

What I'm trying to do is get the view content fragment to include its contents into the base.html layout, but I want it to replace that div, and only display the 3 section tags, and not the div as the parent element. I'm not getting any errors as it…
xil3
  • 16,305
  • 8
  • 63
  • 97
2
votes
0 answers

How to parse JSON string in Thymeleaf for spring-boot application without using Object Mapper?

I am trying to parse following JSON to display information in table format on the web page as shown in the image below. I have achieved this by converting JSON string to object using ObjectMapper and then adding it to model for web page. I am…
Dharita Chokshi
  • 1,133
  • 3
  • 16
  • 39
2
votes
0 answers

Why is Thymeleaf returning a String from my HashMap?

I'm using Thymeleaf and Spring. I have a page on which I want to populate some fields and I'm passing in a Map object to the page model using model.addAttribute as below. pbObject is a PassbackObject that we're using to pass data between form…
medley56
  • 1,181
  • 1
  • 14
  • 29
2
votes
1 answer

How to do arithmetic operations on Thymeleaf variable after declare it with default value?

Here I have declared variable with name someVariable and assign default value 10:

After that I…
Ketan Navadiya
  • 279
  • 3
  • 6
  • 18
2
votes
3 answers

Unable to run spring boot application with thymeleaf

My main application class : package com.sopra.springBoot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Application { public static void…
R.Sehdev
  • 411
  • 4
  • 11
1 2 3
99
100