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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
27 views

How can I get Thymeleaf to work with Hyperscript dynamically?

I have a section of HTML that is being generated by a collection using Thymeleaf. I can iterate over the collection just fine but the issue is when I try and get Hyperscript to see the Thymeleaf ...
cbmeeks's user avatar
  • 11.3k
0 votes
1 answer
59 views

Thymeleaf not recognizing CSS files

I am trying to link a CSS stylesheet using Thymeleaf html. When I run the application and test online no styling is being applied. Below is my html code <!DOCTYPE html> <html lang="en&...
Jadie's user avatar
  • 3
0 votes
0 answers
12 views

Passing sub child to Thymeleaf fragment argument

I have the following Thymeleaf fragment <th:block th:fragment="center-position (content)"> <div class="flex flex-col items-center"> <th:block th:replace=&...
CodeMan's user avatar
  • 109
-2 votes
0 answers
39 views

Script tag in HTML does not run for me [closed]

The script tag does not run when the dom is loaded. I want to access the ${issue} in my .js file. The issue variable is accessible in the inputs but the script tag does not run. I did try console.log()...
Ritik Kothari's user avatar
0 votes
1 answer
21 views

Is there a better way to pass a variable to the view layer instead of using controller?

Each time I create a controller route then I must pass a variable to the view layer : @Configuration public class Config { @Value("${api.url}") private String apiUrl; @Bean ...
pheromix's user avatar
  • 18.3k
0 votes
0 answers
46 views

Spring Webserver not loading/transmitting images completely

I have a Java Spring program that is supposed to display a website with an image. When I run this in the development environment, it works without problems. When I compile my program to a jar file and ...
walkawayfromtheworld's user avatar
0 votes
1 answer
8 views

How to dynamically set path in Thymeleaf fragments?

I have the following Thymeleaf snippet <th:block th:replace="~{'/login/' + ${loginBanner} :: ${loginBanner}}"></th:block> In the controller I set loginBanner to model....
CodeMan's user avatar
  • 109
0 votes
1 answer
44 views

Converting ResultSet map to HTML table for email

I am building a Spring Boot application that runs SQL select queries. I have managed to save the output and display it. Now I want to convert this output to an table in HTML and send it via an email. ...
Beerus239's user avatar
0 votes
0 answers
20 views

How do I get Thymeleaf to read the value of a radio button?

I can't seem to get Spring Boot / Thymeleaf to determine if a radio buttons is checked or not. I am pretty new to Thymeleaf so I assume it's something simple I am missing. My "Search DTO" @...
cbmeeks's user avatar
  • 11.3k
-2 votes
1 answer
40 views

How to avoid HTML text being displayed on website

I have a data that have few details of jobs where I have variable named description, when I try to display the details written in that job description I am getting the code such as, and as well.[...
Gayatri K's user avatar
-1 votes
0 answers
32 views

Error Parsing Thymeleaf Template in Spring

im getting this error whenever i redirect to this url("/orders/current) which shows the orderForm html model. error 2023-09-24 01:42:57.982 [http-nio-8080-exec-7] ERROR o.a.c.c.C.[.[.[.[...
alpha's user avatar
  • 19
0 votes
0 answers
11 views

How to solve this problem "Thymeleaf Plugin ERROR in STS"?

enter image description here ` ` always show this above error when I dowload thymeleaf plugin in my sts. please help me... how to remove this error? ` An error occurred while collecting items to be ...
Avanish Prajapati's user avatar
0 votes
1 answer
19 views

Spring - Neither BindingResult nor plain target object for bean name 'form' available as request attribute

I'm using Java and Spring using Thymeleaf. I have created a form with a couple inputs, IntelliJ is moaning about it saying it cannot resolve the Thymeleaf object attribute. When I try to load the ...
Josep's user avatar
  • 1
-2 votes
0 answers
8 views

how to create - save & edit dynamic rows (with 4-5 fields) into mysql using spring boot, html, jquey,javascript

In my project I have to add dynamic rows with a button click and delete also in my Thymeleaf html page then I should be able to save those rows ( which got 4-5 fields) into database using spring ...
krishna's user avatar
0 votes
0 answers
27 views

Closing an HTML <p> tag without the added line break [duplicate]

I'm working on a java function that generates some html code for an email using a thymeleaf template. I then want to unit test the resulting html string using JSoup. The problem I'm running into is ...
pbuchheit's user avatar
  • 1,387
-2 votes
0 answers
28 views

Why href syntax in thymeleaf works and action (in forms) doesn't?

I'm trying to form correct URL for my controller for editing form with person. So my question is: Why href syntax in thymeleaf works and action (in forms) doesn't? This works: th:href="@{/people/{...
AlexJP's user avatar
  • 1
1 vote
3 answers
110 views

Thymeleaf strings.arraySplit is not working

I have a similar issue like this question: How to split string in Thymeleaf I am getting data by using the below code. <tbody th:each="map : ${InsDashboardData}"> <tr th:each=&...
Manoranjan Jena's user avatar
0 votes
1 answer
34 views

Spring save() inserting instead of merging

I have searched similar topics and found it didn't help unfortunately. I start by providing a button to edit an arbitrary Job <td><button class="btn btn-primary" th:onclick="'...
g00se's user avatar
  • 3,242
0 votes
1 answer
31 views

Spring security expression sec:authorize dont work

I want to show a tag for login to an anonymous user and an a tag for logout tu authenticated user that have ROLE_USER im using the sec:authorize but it doesn't do nothing, dont give me error just dont ...
Niccoló Balzarotti's user avatar
0 votes
0 answers
27 views

thymeleaf +bootstrap+spring boot+postgresql

! Hi, everyone.I'm making a small application and I need to download an image from the database and display this image on the page. A image is the background of a page . There should be buttons (links)...
Mikhail R.'s user avatar
-2 votes
1 answer
44 views

Questions about the html table

enter image description hereI have a question about the table in html. I've been having a headache for three days trying to solve this problem and asked several questions, but it hasn't been resolved. ...
marinewu's user avatar
0 votes
1 answer
27 views

How do I pass a value from localStorage to @PostMapping handler?

I use Spring Boot, Maven, Thymeleaf The user goes to my .html page, enters a value, I put this value to localStorage, then I want to pass this value (maybe as @ModelAttribute) to @PostMapping method, ...
Chrone Void's user avatar
1 vote
1 answer
30 views

Thymeleaf is not rendering authenticated username

I am trying to show the username of the authenticated/logged in user and show LogIn & Singup option when nobody is logged in. I am using the thymeleaf Expression Basic Objects ctx but its not ...
Athul's user avatar
  • 21
0 votes
1 answer
23 views

thymeleaf, how to display a set as a matrix

I have a dynamic set, it could contain any number of images I want to display the images as a matrix of 3 x 3 if the number of images is greater than 9 then add another matrix and so on I am trying to ...
user373201's user avatar
0 votes
0 answers
16 views

Redirect attributes not showing error message on front end (Springboot + Thyemeleaf)

Whatever be the condition (success/duplicate/failed) only the success message is shown on the frontend. Even if I execute a duplicate data, only the success message is displayed. Controller: @...
Athul's user avatar
  • 21
0 votes
1 answer
31 views

CSS var() function does not work in Thymeleaf template to PDF

I'm currently trying to create a report in PDF and am currently trying to use Thymeleaf to create an HTML template which I then try to convert to a PDF using flyingsaucer. It's working fairly well ...
Lynxian's user avatar
  • 180
0 votes
0 answers
18 views

Thymeleaf mapping controller object implicitly

I'm passing an object from a Spring controller to a Thymeleaf page which stores the object and resends it (possibly after a modification): <form id="searchform" th:action="@{/...
Discipulos's user avatar
0 votes
0 answers
10 views

Images are not showing up in front end (Spring boot + View Engine: Thymeleaf)

Images saved as filenames in DB is not rendering thus not shown in the front page. **Model: ** @Data @NoArgsConstructor @AllArgsConstructor public class ProductDto { private Long id; @...
Athul's user avatar
  • 21
0 votes
0 answers
21 views

Error 404 only for some file types (.woff, .map) in spring boot

I have an already advanced project with spring boot with thymeleaf and recently I went to add a new template with awesome font, among others. The problem is: Only for some types of files I always get ...
kastello's user avatar
0 votes
0 answers
12 views

How to extract the content of a Thymeleaf Fragment?

I want to extract the content of a Thymeleaf fragment to manipulate it and set it then into its target tag. The fragment itself is the title tag (I haven't even set a fragment name since the title tag ...
Slevin's user avatar
  • 361
-1 votes
1 answer
22 views

SpringMVC PUT request to edit data but instead, got a new one

I'm practicing Spring/Thymeleaf and facing an issue I create a a PUT request to edit but instead it act as POST by create a new data Here are my codes Controller // imports @Autowired private ...
Kai Iemsawat's user avatar
0 votes
1 answer
17 views

How can I inserting Thymeleaf fragment only if it exists, else ignore it

I'm trying to inject a fragment into my page but I'm using a generic template and the fragment doesn't always exist. This is where I am right now but no matter what I try I always end up with a org....
lawi75's user avatar
  • 1
0 votes
0 answers
11 views

Flying Saucer: Always having first blank page when setting background-image

I want to have a pdf with a background image on a fix number of pages (2 in the example, the 3 page should not have it). I got this working with the following template: <!DOCTYPE html> <html ...
CodeWizard1985's user avatar
0 votes
1 answer
41 views

The "redirect" routing of thymeleaf is redirecting the application to http and not to https when deployed in AWS ECS

I am building a Spring Boot application which consists of Spring Security and Thymeleaf. I have deployed this application in Elastic Container Service (ECS) cluster of AWS. I have my simple controller ...
Nitin Bisht's user avatar
0 votes
0 answers
9 views

Thymeleaf internationalization in large text templates

In Thymeleaf, I have used templates such as ... large text <span the:text="${someImportantNumber}"><span> large text <span the:text="${someImportantNumber2}"><...
qarabala's user avatar
  • 178
0 votes
1 answer
38 views

cannot bind a list of object using thymeleaf

Even if it's not related to the question, you can tell me if there's anything wrong with the code. First, i applied the approach of adding table rows and adding input tags by modal. It was implemented ...
jadekim's user avatar
  • 52
0 votes
1 answer
11 views

How to make a controller variable to be a link inside a table cell?

There is a variable from the controller : model.addAttribute("nomGrilleTarif", "Tarif simple"); I know to show a controller variable inside a table cell : <td th:text="${...
pheromix's user avatar
  • 18.3k
0 votes
1 answer
21 views

Thymeleaf link is not parsed when written inside datatable's columnDefs option

In the columnDefs option of datatable I want to render a link with thymeleaf : datatable = table.DataTable({ ..., columnDefs: [ { targets: [4], orderable: false,...
pheromix's user avatar
  • 18.3k
0 votes
1 answer
97 views

How to unit test a Thymeleaf template using Spring Boot Test

I am parsing a Thymeleaf template using the following bean: import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.thymeleaf....
Paul's user avatar
  • 399
-1 votes
1 answer
26 views

BindingResult errors are not displayed in HTML

After filling out the form and sending the POST request, I receive an error message on the page type=Internal Server Error, status=500 And the console displays the following jakarta.validation....
Денис Шульженко's user avatar
0 votes
1 answer
25 views

How to map/config Thymeleaf's delimiter to parse JavaScript containing RegExp?

When Thymeleaf tries to parse a JS file containing a given RegExp like the following one it will fail: new RegExp("^[+]*[(]?\\d{1,4}[)]?[-\\s\./\\d]*$"); -- -- ...
Slevin's user avatar
  • 361
0 votes
0 answers
27 views

How to setResolvablePatterns() in Thymeleaf?

According to Thymeleaf's documentation it is recommended to set resolvable patterns for different template resolvers. I have two template resolvers, one for HTML and one for JavaScript. The following ...
Slevin's user avatar
  • 361
0 votes
0 answers
29 views

Separate login with credentials and login with certificate in Spring Boot Security

I want to have two logins. In my navbar I have two links: Login, which leads the user to a basic user/password formulary Cert Login, which I intend it to be a login where you can select any personal ...
Thomas's user avatar
  • 1
0 votes
0 answers
38 views

How to set up Thymeleaf Template Engine for JavaScript in Spring Boot?

Thymeleaf seems to be the standard template engine for Spring Boot applications. There are plenty of tutorials to find of how to set up Thymeleaf for HTML pages. Unfortunately I can't find a single ...
Slevin's user avatar
  • 361
1 vote
1 answer
32 views

Spring caching bypassing cached method?

Something weird is happening with Spring Cache; maybe someone can help me know what to look for. I have two Spring Boot applications 1) the "web app", using Spring MVC with Thymeleaf, and 2) ...
Garret Wilson's user avatar
0 votes
1 answer
83 views

How to use Thymeleaf for JavaScript in Spring Boot?

In a Spring Boot application I want to use Thymeleaf to populate a JavaScript file which itself gets preprocessed via babel through WebPack. The Thymeleaf configuration looks like this: @Bean public ...
Slevin's user avatar
  • 361
0 votes
0 answers
24 views

Save the (String) path to the file located on local HDD

How to save the (String) path to the file or folder located on local HDD using Java/SpringBoot/Thymeleaf? Is it possible at all? I use MultiPartFile to upload selected file, but I can't access the ...
krzysztofskul's user avatar
0 votes
0 answers
27 views

Thymeleaf + Spring + text with html special characters not printing new line, instead printing <br>

I have a client name which can be 50 characters long and it can contain html special characters ("&'<>]). This client name is printed in each row of a table. My requirement is I want to ...
Jagga's user avatar
  • 1
0 votes
1 answer
20 views

Thymeleaf th:each noting include din template

I have a Thymeleaf fragment which contains some status text and an th:each which does not appear in the output. I have been able to include the model value in the output its a list<list> and is ...
Ian's user avatar
  • 411
0 votes
0 answers
24 views

Update option in admin panel not working - Spring boot - Thymeleaf

While I am trying to update a category name in my e-commerce admin panel, it is not getting updated. And I am getting following error in my terminal: org.springframework.dao....
Athul's user avatar
  • 21

1
2 3 4 5
185