Questions tagged [spring-thymeleaf]
289 questions
7
votes
1 answer
how to use both thymeleaf and jsp in same spring boot project
I am able to access files under templates folder, But I am not able to access the jsp files.
If I remove the thymeleaf dependency, I am able to access the jsp files, but I want access both thymeleaf html files and jsp files using spring boot.
Below…

Prabagaran Sellamuthu
- 193
- 12
5
votes
1 answer
Setting values in thymeleaf using a map
I Generates a checkbox list from the map. Now how to set the value for the key (false / true) and now I can download it in UserConfig so that I can use this value in the rest of the project.
My view:
3
votes
2 answers
getRequestURI is null with Netty and Spring Boot 3
In Thymeleaf < 3.1 I used below expression to get the request URI.
th:classappend="${#arrays.contains(urls, #httpServletRequest.getRequestURI()) ? 'active' : ''}"
It worked all the time till recently I upgraded to Spring Boot 3.0 that pulls…

Ajay Kumar
- 2,906
- 3
- 23
- 46
3
votes
2 answers
Thymeleaf not loading template
I am using Spring and Thymeleaf. Thanks to xerx593, I was able to get it working so I updated this question to show the working code.
Here is my application class
package com.propfinancing.www;
import…

Neil
- 153
- 1
- 9
2
votes
1 answer
Thymeleaf: Default message from messageKey
I want to set the default message of a translation. But I can only do this by writing the text directly into the template.
The translation of the default message can be done with #{default-message}. I can't find anything about this in the…

Bademeister
- 389
- 1
- 10
2
votes
1 answer
How to use void to delete id not return to another URL Page
@RequestMapping(value ="/user_cart/remove/", method = {RequestMethod.GET,RequestMethod.DELETE})
public void removeData(Long id) {
userReqDetailService.removeByID(id);
}
When i try to use like this if always return to another url…

Mango Play
- 81
- 5
2
votes
0 answers
Replacing an element in a fragment but adding a class name to the replacing element
I'm using Thymeleaf 3.1 fragments to compose a site and I'm running into some issues with including and styling an element that's passed in as a fragment itself. Specifically, I'm trying to set the size of an SVG fragment that's passed in as an…

iansedano
- 6,169
- 2
- 12
- 24
2
votes
1 answer
Spring-boot security 3 - Thymeleaf issue with sec:authentication="principal.authorities"
When upgrading my project from Spring-boot 2 > 3 + creating a native image I am getting the below issue. When I compile it into a jar and run it in JVM it works fine and I can see [ROLE_USER]
Get user from the DB and add to page.
…

Jack Bourner
- 67
- 5
2
votes
0 answers
Thymeleaf 3.1 fails to render base64 image - TemplateProcessingException
I am migrating my application to Spring boot 3.0.1, and the thymeleaf version from 2 to 3.1
I have this line of code:
which…

John P
- 1,159
- 2
- 18
- 44
2
votes
1 answer
how can a user change their password in this website?
I'm creating a website using Spring Boot. I have a template (thymeleaf) in which users can change their password. But when the user writes a new password the password doesn't change. It redirects to my homepage but nothing happens. There is no…

mahboy
- 23
- 2
2
votes
1 answer
spring boot with thymeleaf html table with class model array
I got this class model (I made it only 2 column),
public class DataModel {
private int id;
private String name;
public DataModel() {}
public int getId() {
return id;
}
public void setId(int id) {
this.id =…

Ricky Vene
- 105
- 1
- 11
2
votes
1 answer
Spring Boot & Thymeleaf - Localized text does not appear
I am currently working on the localization of my (second) Spring Boot project. However, I have come to a halt after several hours of struggling: I am unable to get a user-editable Session localization.
The problem appears to occur as soon as the…

Theo Huwume
- 35
- 8
2
votes
1 answer
How to use Thymeleaf layout dialect with Textual Syntax?
I'm trying to use the layout:decorate directive with a text file (plain text email header/footer)
Template begin called:
[# layout:decorate="~{email/plainPart}" th:with="subject=${subject}" ]
[# layout:fragment="content"]
Thanks for ordering [(…

checketts
- 14,167
- 10
- 53
- 82
2
votes
1 answer
How to pass multiple arguments in a single Javascript method using thymeleaf onclick (th:onclick)
I tried the following syntax but it didn't work for me. Please let me know the answer.
Javascript Code --->
function passValue(id, name){
console.log(id)
console.log(name)
document.getElementById("updateId").value=id;
…

DILIP KUMAR
- 23
- 3
1
vote
0 answers
Error when adding a Thymeleaf layout to my Spring Boot application
I'm trying to add a header to all the pages of my Spring Boot application, so I want to use Thymeleaf to add this layout.
But when I'm trying to access my home page for exemple, I get this error message :
Error resolving template [accueil], template…

Albinch
- 11
- 1