Questions tagged [spring-thymeleaf]
289 questions
0
votes
1 answer
springboot thymeleaf html create link
I have this springboot thymeleaf html,
@GetMapping("/rest")
public String list(Model theModel) {
// add to the spring model
theModel.addAttribute("list", theModel);
return "menu-list";
}
menu-list.html,
…

Ricky Vene
- 105
- 1
- 11
0
votes
0 answers
How to bind comma-separated string to List in Thymeleaf?
In a html file, I am trying to get the fields and values in the following DTO using Thymeleaf:
ValuesDTO(serving=100.0, unit=G, energy=160.0, protein=5.0, totalFat=7.0)
So, how can I list values as the following? The labels are static, I just need…
user19726424
0
votes
1 answer
Controller printing the template name
I have a little problem when I push a button on my page that should just get a template and display it, it doesn't happen but the actual template name is printed on a white page in browser. I have a completely same controller set up and template for…

Deni Bakulić
- 47
- 8
0
votes
1 answer
how to compare thymeleaf dynamically created guid with list of guid in Thymeleaf
I have a list of guid in listOfShortlistedProfile as [cc0dfb4d-4b08-4f08-a8ce-10f12f860ed5, c6bc6a26-a9e0-4ca0-855a-2eeff3922998, a5b3b65b-76c5-446f-a083-4707ac3080d7] and I have a dynamic guid as ${searchResult.GUUID} as one value as…

Ravi
- 1
- 4
0
votes
1 answer
Spring + Thymeleaf creates new record instead of updating
I am trying to update an existing record but instead, it creates a new record even though the primary key is not a null value. Also, the subject field is returning null. I'm using the CrudRepository from spring framework.
What I want to happen is…
0
votes
1 answer
How to change the color of a button based on value from Spring mvc?
I have a service class as follows:
package com.sample.service;
import org.springframework.stereotype.Service;
@Service
public class TestService {
public int Server() {
int a=90;
int flag=0;
if(a>85) {
…

Banu
- 1
0
votes
1 answer
Trying to export PDF using Java, Thymeleaf and Spring Boot
My intention is to export a list to PDF. The list originally came from an XML file, then sorted and put into a list.
I am creating a web interface that would instantiate the export to PDF function. The code below allows a PDF to be created however…

Neet
- 1
- 3
0
votes
2 answers
Why is the html page not loading - using Spring boot, java, and thymeleaf
This is the Controller page:
@Controller
public class AppController {
@Autowired
private UserRepository userRepo;
@GetMapping("")
public String viewHomePage() {
return "index";
}
@GetMapping("/index")
public String logoutPage() {return…

Neet
- 1
- 3
0
votes
0 answers
SpringBoot Downstream API Post Request
I am trying to pass an HTML form through a downstream API using Springboot and Thymeleaf but the response I am getting is:
org.springframework.web.client.HttpClientErrorException$BadRequest: 400 :…

autoboss
- 11
- 3
0
votes
0 answers
Convert HTML with CSS3 to PDF in Java
I am generating invoices dynamically using thymeleaf and HTML and have used bootstrap 5 to lay out the whole thing which uses CSS3 but when I need to generate a PDF from HTML, everything works fine but the layout gets messed up as the used library…

Yash garg
- 53
- 1
- 7
0
votes
1 answer
HEX code color with thymeleaf for css inline
I want to change colour dynamically using HEX code with inline CSS in the thymeleaf template.
But when I set hex code colour in the context.setVariable("invoiceColor","#E01B33"), the result of this template comes as \#E01B33.
Context context…

Yash garg
- 53
- 1
- 7
0
votes
1 answer
Why my Spring boot application does not validate form
I have a bit of a problem. So I'm trying to make a form validation. I enter incorrect data and it doesn't show any problems and saves user even it should not do that. If I don't select any country, it crashes becouse it gets null. Binding result…

Darius
- 1
- 1
0
votes
1 answer
image is not showing in html thymeleaf springboot
I am using thymeleaf along with springboot
I am not able to view any images in my HTML file. I have tried all different ways of doing
the same in thymeleaf but no luck.
Here is my project folder structure
src
└─── main
…

nikita sharma
- 1
- 1
- 3
0
votes
1 answer
Thymeleaf call a bean on a form field before submit
Let us suppose to have a bean:
@Bean
PasswordEncoder getPasswordEncoder()
{
return new BCryptPasswordEncoder();
}
and on the html page:

Discipulos
- 423
- 8
- 23
0
votes
1 answer
Thymeleaf decorator problem after upgrading spring boot to greater than 2.5.4
I have a MVC application based on spring-boot:2.5.4.
After migrating from spring-boot 2.5.4, to 2.5.14-2.6.7 Thymeleaf layout does'nt import header (header tag is empty) and leaves blank other inserted elements( like layouts/sidebar :: sidebar,…

Beri
- 11,470
- 4
- 35
- 57