Questions tagged [spring-thymeleaf]
289 questions
0
votes
1 answer
Send javascript HashMap to Thymeleaf field constructor
I have a normal Java object that holds a parameter of type
private HashMap lizt = new HashMap()
public ObjectTemp(HashMap lizt ) {
this.lizt = lizt ;
}
And a JavaScript map that contains the data
var map1 = new…

b s
- 1
- 2
0
votes
1 answer
springboot with thymeleaf two way binding
I'm trying to use thymeleaf with springboot. but some problems happened and I don't why.
Here's my code:
@GetMapping
public String main(Model model) {
Map map = new HashMap<>();
map.put("field1", "value1");
…

Liem
- 446
- 1
- 6
- 20
0
votes
0 answers
Spring-Boot - Redirect to an url with an ID in it
I do a simple vocabulary application as a practice. It can insert new vocabularies and then open that vocabulary so you can add some words in it.
My goal is to insert those words with a modal and with the button Save redirect to that current…

Bnc
- 23
- 4
0
votes
1 answer
html thymeleaf directly post in a select option
I want directly push the selected option. But i dont find a solution. Maybe u can help me?
I have a table with a list of entities. And i will offer a select for every entity. But i want to save the selection directly.
I need the entry.id and the…

Bianca
- 21
- 4
0
votes
1 answer
Request method 'POST' not supported error for Thymeleaf th:method="put"
I've got this error after I submit following form:
There was an unexpected error (type=Method Not Allowed, status=405).
Request method 'POST' not supported
org.springframework.web.HttpRequestMethodNotSupportedException:
Request method 'POST' not…

Mehdi Rahimi
- 1,453
- 5
- 20
- 31
0
votes
1 answer
thymeleaf th:if - Cannot index into a null value
thymeleaf index.xhtml -
EL1012E: Cannot index into a null value
Folder:

skdonthi
- 1,308
- 1
- 18
- 31
0
votes
1 answer
Submit button doesn't work in spring boot
I have MVC project on Spring Boot that suppose to do CRUD operations. Basically it has two models, which represents Forum Theme and Article of this Theme. And I want to add new Themes or Articles. Now I stuck on submitting form data, managed with…

Dominus Nox
- 3
- 1
0
votes
1 answer
How to convert a string to date in Thymeleaf?
I have the following input:
And oh this is the fragment of the DTO into which they are inserted…

xampo
- 369
- 1
- 7
- 22
0
votes
0 answers
How do I change the thymeleaf version?
Im using spring-boot-starter-thymeleaf version 2.7.0. Im facing a problem in my code that im fairly certain is a bug with thymeleaf. How can I try out the latest release of thymeleaf?
Ive tried the instructions on this link:…

KenobiBastila
- 539
- 4
- 16
- 52
0
votes
2 answers
How to launch a modal window with a signal from the server
Programs, languages and frameworks used:
Java
IntelIJIdea
SpringSecurity
Thymleaf
Html
JavaScript
I have a page product.html on which there is a product. The user clicks on the order item button. I'm sending a signal to the server.
If the object is…

Сергей
- 111
- 4
0
votes
1 answer
Thymeleaf - th:checked works, th:field fails
Thymeleaf
Im trying to bind a variable called 'permitirAcesso' to thymeleaf. When I use th:checked, it shows the value correctly. When I use th:field, it doesnt bind. What should I do?
I investigated and th:text shows the correct value. Ive also…

KenobiBastila
- 539
- 4
- 16
- 52
0
votes
0 answers
select dropdown thymeleaf if disabled not fetching value in controller
If I use readonly, it grey out the dropdown but I am still able to select values and when I click save I am able to see value got fetched in the controller. But if I use disabled, it grey out and select the correct value (so looks good on UI) but…

TryMine
- 1
- 1
0
votes
1 answer
Content-Security-Policy nonce mismatch on error pages (e.g. 404)
We use a Content-Security-Policy nonce successfully on normal pages (Thymeleaf templates). But when we try to do the same on error pages (e.g. 404), the nonce received as a model attribute does not match the nonce specified in the…

user19281570
- 1
- 3
0
votes
2 answers
logout in spring 5 and thymeleaf does not work anymore with my code; in spring 4 it did
With spring 4, logout worked with de code below, but with spring 5 it does not anymore.
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Bean
protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
…

ericj
- 2,138
- 27
- 44
0
votes
1 answer
Passing in String variable to custom user details method
I have a customer user which has a custom method which takes in a String argument/variable
public String someCustomMethod(String stringVar) {
return "hello " + stringVar;
}
I am making the following call from my web page and it's…

Simon Tilbury
- 37
- 1
- 1
- 5