Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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 ...

0
votes
0answers
14 views

NULL for nested Object in Dto

Hi everyone! It's my first post here so please be understanding. I have some problem with my code in first application to github. I have view, where try add Question with Answers to my database. When ...
0
votes
0answers
17 views

How to send data from one page to another using Thymeleaf

Good day! I have a task to write a blog with Spring Boot and Thymeleaf. Nothing special, common CRUD operations. I have a problem sending data from one HTML page to another. Answer given here: ...
0
votes
0answers
22 views

How to pass huge amount of data fromThymeleaf to controller

This is my 1st time that i'm posting any question on stack overflow,please ignore if commiting some mistake. I'm trying to pass data from html to the controller,that works well if character is ...
0
votes
1answer
18 views

Thymeleaf + static resource + @ResponseBody

In Spring Boot, I've got the simplest controller ever, returning my view name: @Controller public class HelloController { @RequestMapping("/hello") public String hello() { return "...
0
votes
2answers
28 views

Ajax call to spring boot controller to redirecting a view

I'm new to spring boot framework. I have a jQuery method that gets called upon the click of a span element. In that jQuery method, I have an ajax call which makes a call to the spring boot controller ...
1
vote
0answers
15 views

Thymeleaf Master Layout Content Dynamics issue

I have got some issue as I mentioned in the title. This is my master page : Admin.html <header class="main-header"> <th:block th:include="@{admin/fragment/header}"></th:block> ...
1
vote
2answers
18 views

Thymeleaf Spring boot - input Localdate

I'm writing a program in Spring boot and my database is postgre. i have a problem with thymeleaf. I try to input a localdate value but the value remain null. i dont have any problem with another ...
1
vote
1answer
20 views

Themeleaf looping using th:each

I am trying to go through a list from a db and post it on an html form. The only way I got it to work was by using the following code: <tr th:each="customer: ${rxReqBean.iCustomer}"> ...
1
vote
0answers
20 views

Spring boot mvc with Thymeleaf4. Nested fragments

Have a spring boot mvc project, on which I try to learn the Thymeleaf4(I know there is a never version, but currently sticking to the one, I've started from) engine functionality. Struck to a point ...
0
votes
1answer
18 views

html/thymeleaf - How to prevent input field detected as credit card related fields?

Chrome detects some input fields as credit card fields. How do I avoid it in HTML? It seems that Chrome will detect such fields using some regex on field names etc (see: here). The only known ...
0
votes
1answer
81 views
+50

Could not parse as expression defining a DataTable in Thymeleaf

I have a basic SpringBoot 2.0.4.RELEASE app. using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file. I have this definition of a datatable in ...
1
vote
2answers
28 views

Make image clickable based on certain condition in Thymeleaf

i am gettting an attribute html "image_clickable_status " , if it is true , i need to make the image clickable and if it is false the image should not be clickable. Below is what i am trying to do &...
1
vote
2answers
24 views

Thymeleaf 3 (not) building layout sequentially?

I know about existance of layout dialect for Thymeleaf (https://github.com/ultraq/thymeleaf-layout-dialect), but before jumping into said dialect dating pre thymeleaf 3, I wanted to explore newer ...
-1
votes
0answers
41 views

How to redirect to different html via button click using thymeleaf

This is really stupid question, but I'm trying to make a Spring Boot application... Let's say I've figure out backend and got my Repositories and REST done, but now I'm trying to figure out basic ...
1
vote
1answer
32 views

Invalid property 'fields[0]' of bean class

I am working with spring and my entity is myEntity.java @Entity public class Ecran { ... @OneToMany(fetch=FetchType.EAGER, cascade = { CascadeType.ALL } , mappedBy="ecran") public Set<Fields> ...
0
votes
1answer
44 views

Filling table from database thymeleaf

I want to fill calendar which is formatted as a table - each column is a different day of week, each row is a different hour. I think i need to send two parameters to controller (i have day and hour ...
0
votes
0answers
52 views

How to add a converter to spring template engine context?

I want to manually process a thymeleaf fragment and return the resulting HTML code to the client. The fragment contains a serialization of a passed variable. I have the following code: @Component ...
0
votes
2answers
30 views

Form validation with Java Spring 4.0 and Thymeleaf

Ok here is my project. but the form validation doesn't work. Meaning that I can add customers with empty fields, which shouldn't be happening. Here is my model class. public class Customer { @...
0
votes
1answer
11 views

Thymeleaf remove block of code

I use thymeleaf 3 and bootstrap 4 I have this code <div class="row"> <div class="col-md-6" th:text="#{summary}"> Summary <ul class="list-group"> <li class=...
0
votes
0answers
17 views

How to recreate an object in a thymeleaf form?

I'm trying to update only a part of my HTML page. Currently, Im passing a model attribute from controller to thymeleaf form so I could bind object like this: <form id="formTest" class="form-inline"...
0
votes
1answer
20 views

Could not obtain transaction-synchronized Session from Thymeleaf

I was working with SpringMVC and it was ok with my jsp pages, but now I've tried to integrate my application with Thymeleaf. thymeleaf-servlet.xml <beans xmlns="http://www.springframework.org/...
3
votes
1answer
48 views

How to unit test spring datetimeformat validation

I have a DTO class holding two date fields. Both are annotated with a @NotNull and @DateTimeFormat. I'm doing TDD and I noticed my NotNull error message is returned successfully but when I pass in a ...
1
vote
2answers
30 views

Thymeleaf submitting a collection of abstract type

Given a class: public class Foo { private List<Bar> bars = new ArrayList<>(); //getter and setter } Where Bar is an abstract type looking like this: abstract class Bar { ...
0
votes
1answer
10 views

Thymeleaf default fragment in case reslution fails

I have a fragment which is evaluated from a field value <div data-th-replace="fragments/${obj.fooType} :: ${obj.fooType}( fieldPrefix='obj.bars[__${barStat.index}__]')"></div> This works ...
0
votes
0answers
22 views

How i can ignore th:text in thymeleaf

We Want create a projet to frontend use thymeleaf without eclipse. We need process thymeleft to use fragments, th:insert, th:replace etc. The frontend need create layout, but doesn't need variables ...
0
votes
1answer
15 views

Thymeleaf submit ignores list of objects

Given a class looking like this: public class Foo { private List<Bar> bars = new ArrayList<>(); //getter and setter } Initialized with either an empty list, or with values added ...
0
votes
0answers
10 views

Thymeleaf bind input to local variable

I have a select list in my form which does not belong to the bean the form binds to. It is supposed to be used in conjunction with a button which would call a controller method to add another item in ...
0
votes
1answer
17 views

Upgraded Spring Boot Starter Parent - Thymeleaf Dialect layout:decorator broke

I upgraded Spring Boot Starter Parent from 1.3.3.RELEASE to current 2.0.4.RELEASE using the spring-boot-starter-thymeleaf package. After the upgrade the attribute layout:decorator no longer work. The ...
0
votes
1answer
28 views

How to use thymeleaf without controller

I want to use thymeleaf templates in my spring boot application. I've some html pages in the src/resources/public directory and I want them to be served wihout writing a controller because I want to ...
0
votes
1answer
28 views

How to send object or data to controller from html file?

I get the "explorer" object in the html file and can analyze it: <!DOCTYPE html> <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml"> <head> <meta charset="UTF-8"> ...
0
votes
1answer
27 views

Input field is not transmitted

I have a table where the user can enter some values and transmit these inputs to my backend via a POST request. Each row consists of a type, brand and some input fields like buyprice, bottom, top, ...
1
vote
1answer
44 views

Spring Boot 2.0.4 + Thymeleaf 3.0.9: Could not initialize class HTMLTemplateParser

I am trying to run a basic webapp using Spring Boot with Maven and Thymeleaf. This is my environment: MacOS High Sierra 10.13.6 (the latest version) Java 1.8 (which should be compatible) Spring ...
-1
votes
0answers
34 views

Why spring with tymeleaf not find resouces css and js

Why spring with tymeleaf not find resouces css and js. Code error: Refused to apply style from 'http://localhost:8080/static/js/bootstrap.min.js' because its MIME type ('application/json') is not a ...
0
votes
0answers
21 views

Thymeleaf: add CSS offline

I'm using thymeleaf to generate PDF in background processes (batch) using Spring Boot 2... To add some style to my PDF's I would like to add some CSS using this. <link rel="stylesheet" href="...
0
votes
0answers
20 views

Thymeleaf input type=“date” can not display and update

I can't find the right way to display the "birthday" field from datbase! Even when i try to submit the new value to db, it doesn't work. What i'm doing wrong? Here is my code: Controller @...
0
votes
1answer
16 views

Multiple select in Thymeleaf doesn't store chosen options

I'm trying to learn Spring and other related technologies during summer break by developing a simple web application, however Thymeleaf hinders my progress. The program is based on two entity classes:...
0
votes
1answer
25 views

How to enable or modify security configuration for jhipster with thymeleaf?

I want to use thymeleaf instead of angular JS. I can use templates with out security and i can add httpsecurity for that URL, My question is that how to authorize the URL? currently I am using JWT ...
0
votes
1answer
20 views

How do I round a decimal result up in Thymeleaf (same behavior as Math.ceil)?

I am doing table pagination logic for my project using Thymeleaf. I have two values: int totalRows int rowsPerPage The operation I want to do is something along the lines of Math.ceil((1.0 + ...
1
vote
1answer
33 views

ThymeLeaf pass variable to vue js

Thymeleaf th:attr not working with Vue bind property <truncate th:attr="'v-bind:text'=${message}"/> The above line not giving me error in both Vue and Thymeleaf but nothing display on page ...
1
vote
1answer
17 views

CSRF JS Metatag Creation w/ Thymeleaf

I am going out on a limb as I'm not certain this is even possible but I was looking to create two CSRF meta-tags (header and token) within a javascript file which is used through out the site. ...
0
votes
1answer
14 views

Substitute for TemplateResolver in 3.0.0 version of thymeleaf

I have substituted Thymeleaf 3.0.0 from 2.1.6 version because of which TemplateResolver cannot be resolved to a type.It is deprecated in 3.0.0 version .Can anyone tell me what is the substitute for ...
0
votes
1answer
21 views

Index page not showing DataTable

I have a problem using DateTable in my application, I'm using Thymeleaf in my front-end and spring-boot in my back-end, I'm trying to add a DataTable to my index page but nothing happens, I only get ...
-2
votes
1answer
53 views

How to access an object key in Map without iterating in Thymeleaf

I have a java class Result and It contains a variable called results and it is a HashMap. public class Result { private HashMap<Class1, Class2> results = new HashMap<>(); } I'm ...
1
vote
3answers
45 views

Thymeleaf post form doesn't submit data

I am new to Thymeleaf, I try to execute a simple form submittion using Thymeleaf and Spring. Controller looks like this @Slf4j @Controller public class BookController { private static final ...
0
votes
1answer
32 views

Multidimensional array search in Thymeleaf?

Is it possible to check if a specific element exists on a 2D array? <div th:each="employee, i : ${company.employees}"> <div th:each="duty, j : ${employee.duties}"> <div class="...
0
votes
2answers
23 views

Thymeleaf nested object iteration

I am trying to iterate over a list that contains another list. @Entity @Table(name = "session") public class TrainingSession implements Serializable { @Id @GeneratedValue(strategy = GenerationType....
0
votes
0answers
22 views

How to transfer an object from the form with a list of other objects?

I'm new to thymeleaf and spring. There is a Person class that contains the fields Set <'Addtess> and Set <' PhoneNumber>. After editing, you must save the changed data. How to transfer from the ...
1
vote
1answer
54 views

Spring Boot can't resolve Thymeleaf view

I integrate Spring Boot with Thymeleaf but the web doesn't redirect or forward after the controller returns a view. This is Thymeleaf page: <!DOCTYPE html> <html lang="en" xmlns:th="http://...
0
votes
2answers
35 views

Spring Mvc passing model data to multiple pages before persisting

I am in the process of creating a simple application with Spring Mvc and thymeleaf and I am currently thinking of what functionality I want to implement but I don't know exactly how to do it. Let's ...
0
votes
1answer
32 views

Thymeleaf: Use a link with 'th:href' in Javascript

I have the following link: <a th:href="@{/linkToPage}">...</a> which works. But now I have a workaround where I have to "create" this link in Javascript: $('#div').html( '<a th:...