Questions tagged [spring-thymeleaf]
289 questions
1
vote
1 answer
Add multiple style elements to thymeleaf with conditionals
I am designing a thymeleaf template. I have a table row with data where I am using the below conditional code to colour its data. Any idea on how I can add other style elements such as padding and text-align to the table data 'td' tag ?
the last item
Retrieve individual values from Map

jane
- 211
- 9
- 30
1
vote
0 answers
Cyrillic symbols are displayed incorrectly
I'm trying to pass some information from a browser to my server and end up having '????' symbols. I thoroughly searched for this problem on the Internet and StackOverFlow but in the end nothing helped me. My assumption is Thymeleaf/Spring continues…

KRL
- 11
- 2
1
vote
1 answer
the last item from the modal menu is not displayed at the bottom of the page
I have a table with data on every row, at the beginning of each row I have a button which contains a modal with the following options:
create
read
update
delete
This modal is displaying every item correct except for the last line on the page,…

Andrew
- 280
- 1
- 3
- 12
1
vote
1 answer
How to escape right parenthesis in variable?
How can I escape a round bracket (right parenthesis) without closing it in a fragment?
"fragments/questionaire :: questionaire('00001_c-1',
${
{
'...',
'...',
'First 1) ...'
}
…

th_lo
- 461
- 3
- 18
1
vote
2 answers
Retrieve individual values from Map by key in Thymeleaf without iteration
I tried all the different variations of myMap.get(key), myMap[key], etc. to get this line of code working where myMap is a Map and thing has a property called state:
Any…

tippershurt
- 11
- 2
1
vote
2 answers
How to test template engine while styling emails with junit and mockito, spring boot
I am sending an email with a thymeleaf template engine. When I didnt use thymeleaf, the mail Unit tests were running perfectly, but after I added thymeleaf the tests keep giving me NullPointerException.
Here is my code from the EmailService:
…

userdev1407
- 23
- 2
1
vote
1 answer
Chartjs Stacked bar graph with forEach for labels
sorry if this has been answered already but I cant figure how to include labels in my for each. Im getting my data from spring boot with the data called 'employees' and there is 20 something employees in the 'employees' data. I loop through and add…

Kayd Anderson
- 81
- 7
1
vote
1 answer
Spring Boot Thymeleaf - Error resolving template [...page], template might not exist
For POC purposes we work with Thymeleaf in a Spring Boot configuration.
Can you help me solving this error:
Error resolving template [chatloginpage], template might not exist or
might not be accessible by any of the configured Template…

tm1701
- 7,307
- 17
- 79
- 168
1
vote
0 answers
How to update a table row by passing data from a Bootstrap modal form
I'm fresh in web development and I'm facing some problems
I have an html page that displays a table. Each row contains data and an "edit" button.
What I want is the following:
I already could invoke the modal form and make it pop up with data…

Majid
- 51
- 7
1
vote
1 answer
Replace a string in Thymeleaf
My problem is when I use the character ', Thymeleaf converts it to '.
I need to show the apostophes instead.
My string is saved in SQL like this:
"body" : "L'' autorizzazione di EUR [[${…

Sonn
- 89
- 8
1
vote
1 answer
OGNL 3.3.3: not compatible with spring boot 2.7.2 because of thymeleaf?
I am doing an upgrade of all my dependencies of my spring-boot project but I cannot upgrade ognl dependency from version 3.1.12 (containing the vulnerability CVE-2020-15250) to the last version 3.3.3 because I use the process() function on…

phildeg31
- 169
- 1
- 14
1
vote
1 answer
Can not edit data from database via thymeleaf and spring
I want to edit data from database via form "bookUpdate.html", that I can open from page "bookList.html" with the list of all rows from the table. I created a controller and form, that redirect me to the page with filled fields, that contain right…

Anastasia
- 23
- 5
1
vote
1 answer
Edit data in the database
I want to edit exist data from database via html-form with field. But I can not create a right controller for it, because this code just created a new book. Old data was not changed.
Controller
@GetMapping("/bookUpdate/{id}")
public String…

Anastasia
- 23
- 5
1
vote
1 answer
th:attr in Thymeleaf XML mode lowercases attribute name
What are the differences between XML and HTML mode when doing variable insertion? I can't find anything in the docs and couldn't find the answer after half-an-hour of looking at the source code.
See the issue I created for this for an explanation…

Joshua
- 177
- 3
- 3
- 14
1
vote
0 answers
THYMELEAF error - Error resolving template
I see this question with hundreds of answers, none of which have worked for me yet. I am building a simple asset tracker. My controller has two functions
@Controller
public class GpsController {
private double bestLat = 0.0;
private…

Guy Fawkes
- 53
- 5