All Questions
3,832 questions
-1
votes
0
answers
34
views
Cannot add spacing in Thymeleaf
HTMl template thymeleaf Code below -(other code is different using div and span tag )
WHOLE Frontend CODE
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "...
0
votes
0
answers
23
views
Reusable modal fragment thymeleaf
I am trying to reuse the following modal (as a fragment) with thymeleaf.
<th:block th:fragment="modalFragment (modalId, labelId, modalTitle, formId, saveButtonId, fields)">
<div ...
0
votes
2
answers
51
views
Is there a way to call utility method in TEXT Thymeleaf template?
I have application aimed to transform API responses into human-readable text. For that purpose I call data from 3rd parties, build the model from it and run template against context through org....
0
votes
0
answers
30
views
Add checked object's id to list passed to model as attribute
I need a help with dynamic checkbox list handling. I want to add id of item to list of ids (class name SelectedIds and instance name selectedIds in code) that I passed to my template (its name is ...
0
votes
1
answer
20
views
Spring+Thymeleaf - Map as form-backing bean
Supposing I have the following controller code:
@ModelAttribute("test")
public Map<String, String> test() {
Map<String, String> someMap = new HashMap<>();
...
0
votes
1
answer
31
views
Problem with html files in subdirectories and ControllerAdvice
I changed HTML files location and moved them to subdirectories in resource/templates. The problem is after changing location, my @ControllerAdvice class and @ExceptionHandler stopped working with ...
0
votes
2
answers
41
views
Spring Boot: Participants Not Displayed in Schedule Despite Being Present in Database
I am working on a Spring Boot project where I have a Schedule entity that has a many-to-many relationship with a User entity. The participants are correctly added to the schedule in the database, but ...
-1
votes
1
answer
31
views
Why am I getting a 404 Not Found error in Thymeleaf Using SpringBoot
I have a controller that is using the RequestMapping annotation but whenever I visit the /books page I get a white label error.
package come.saeedado.controllers;
import come.saeedado.BookDemo....
0
votes
1
answer
48
views
How to migrate from th:include in Thymeleaf 3.1?
As of thymeleaf-3.1 th:include is deprecated (
https://github.com/thymeleaf/thymeleaf/issues/913), so I'm trying to migrate my includes, but without success.
My goal is to having a fragment that ...
0
votes
2
answers
42
views
Failing to process Thymeleaf template as a String
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import org.thymeleaf.templateresolver.StringTemplateResolver;
import org.thymeleaf.templatemode.TemplateMode;
import java....
0
votes
1
answer
33
views
How to reuse the 2 text fields from one form block to another in HTML and Spring boot?
I am new to HTML and Spring boot.
I have this html form index.html
I am trying to build a simple calculator with add/subtract and multiply functions.
I have 3 form blocks which points to 3 endpoints ...
0
votes
1
answer
100
views
Spring Boot App throwing a strange exception
I am following a tutorial and everything seems to work for the author but not for me.
The purpose of the use case is to add a new category (id, name, image and a boolean value).
Category entity:
@...
-1
votes
1
answer
136
views
SpringBoot 3 An incompatible version of the Apache Tomcat Native library
I have an application using springboot 3 (3.3.4) which is being developed in Windows 11 with thymleaf and bootstrap 5 using intellij. The application compiles and runs under windows with no errors. ...
2
votes
1
answer
51
views
How to display errors in Thymeleaf
I have a custom password validation implemented using ConstraintValidator, and I need to display error messages when the validation fails. But error messages are not being displayed when the ...
0
votes
0
answers
28
views
Thymeleaf, get list then post object from this list
Im getting list of Order and make table with it + button next to every Item.
On click button i want to post this single Order from list to API.
The problem is when i press button, i receive on API ...
0
votes
0
answers
15
views
Thymeleaf Issue: Unable to Retrieve Correct ID Values
The issue arises when attempting to pass the dynamic goodsId from HTML to a JavaScript function. Instead of the expected numeric value, the goodsId is being treated as a string literal (e.g., ${row....
0
votes
0
answers
43
views
on intellij using spring boot and html, i cannot add data to my database through the html
i have created a simple structure on intellij , using spring boot,java and html and mysql to create a database. What I want to do is from the html to fill the format and the data will be saved in my ...
-1
votes
1
answer
56
views
how to change number from 17072e7 to 10720000
i want to display the gpu price from exponential form to decimal in Java springboot im using thymeleaf
enter image description here
<h2>Pilih GPU</h2>
<select id=...
0
votes
0
answers
45
views
Spring + Thymeleaf Nested Form Backing Object Variables
I'm having null pointer errors when attempting to reference a form backing objects nested variables.
For example
...
<input th:field="*{workOrder.customer.name}">
...
0
votes
0
answers
27
views
I'm getting TemplateInputException for my HTML file in springboot
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [Kredit-bee-invoice], template might not exist or might not be accessible by any of the configured Template Resolversenter ...
-1
votes
1
answer
98
views
"Instantiation of new objects and access to static classes or parameters is forbidden" error with th:action
I'm working on a Spring Boot application using Thymeleaf for the view layer. In one of my templates, I need to create a form for updating a book. However, I'm encountering the following error when ...
0
votes
0
answers
39
views
Spring Boot and Thymeleaf error, the data not appering when I add the data from the input
Image I'm submitting the pollThe application is used for creating polls, polls can have many questions and questions many options, So the issue is that when I add e new survey(poll) in default we have ...
0
votes
1
answer
57
views
Spring Boot Controller not detected despite Correct Package Structure
I have an issue where I am trying to connect the WebController with the Thymeleaf templates and get this Error when I'm trying to access the page http://localhost:8080/home:
Circular view path [home]:...
-1
votes
1
answer
42
views
In SpringBoot Html In Not acess or Not Showing other in webPage Value of that
This is my Index.html file
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Greeting Page</...
0
votes
0
answers
42
views
Spring Security , session security with Thymeleaf
why i have these errors when I try to login , i want just try to log in but something went wrong , it must be redirecting to successUrl but it don't do that .
here is my security configuration
@...
0
votes
1
answer
181
views
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid req
<div class="form-group">
<label for="landlordId">Landlord</label> <select
class="form-control" id=&...
-2
votes
1
answer
106
views
Method 'POST' is not supported - Spring [closed]
I'm trying to send a post request to Spring but I always get this error: Method 'POST' is not supported
I also get this error when trying to post data
I'm using eclipse and spring boot, my project ...
-1
votes
1
answer
31
views
RemoveSession using thymsleaf
I have created a CommonServiceImpl, it is responsible for removal of session in spring boot project. But I get a Potential null pointer access error by getAoccur please help me get rid of this error.
@...
0
votes
0
answers
37
views
How to get radio th:field value in back-end (binding Thymeleaf)
<input type="radio" th:field="*{questoes[__${iter.index}__].respostaCorreta}"
th:value="${alternativa.texto}">
I'm working on a project using Thymeleaf and ...
0
votes
1
answer
75
views
How to display a Java variable onto ThymeLeaf HTML using the span tag?
I'm currently writing a project that incorporates the use of ThymeLeaf HTML for the frontend and Java for the backend. I'm trying to display a variable from one of my Java controller classes onto my ...
0
votes
1
answer
127
views
how to make Spring security allow access to enter home page without login?
I set up spring mvs project and added spring security, i want everyone see home page without login.
here is my security configuration:
package uz.smartup.academy.bloggingplatform.config;
import org....
1
vote
1
answer
141
views
Thymeleaf about th:block statement
I'm trying to use th:block to make table more specific to analyze my data..
i was trying
<table>
<thead>
<tr>
<th>something</tr>
<th>...
2
votes
1
answer
65
views
Cannot convert value of type String to required type PersonDTO for property 'person'
I have a class named Tabel that has an person. The classes Tabel and Person have a one-to-many relationship.
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "tabel&...
0
votes
1
answer
95
views
Java Spring Thymeleaf `th:each` inside `<style>` tag
Active languages of my web app are stored inside the Java List and that list is available to Thymeleaf.
Outside <style> tag this is easy and working like a charm:
<button th:each="lang : ...
0
votes
0
answers
63
views
Outlook is not accepting html content
I am sending email using java SMTP but outlook is not rendering the text/html content . Here is what is email body what outlook is rendering
<p id="content">Dear User,<br>...
1
vote
0
answers
32
views
Can/should you use th:attr with th:insert/replace in thymleaf? Fragments with elements whose attributes can be dynamically set
I like the principle of DRY (Don't repeat yourself) in coding. And while I continue to learn thymeleaf, I am running into this error I am unable to resolve.
So the general idea is as follows, I want ...
0
votes
0
answers
40
views
my template might not exist or might not be accessible by any of the configured Template Resolvers
I have a problem, my template code (thymealeaf) is stored in the database, and my project is to call the template from the database and convert it to pdf using itext7.
Here's my code:
public void ...
0
votes
0
answers
51
views
I want to save data from the same form to two different tables without declaring the second model in my save method
UserController.java:
@Controller
public class UserController {
@Autowired
private CensusRepository UR;
@GetMapping("/")
public String home(Model model){
...
1
vote
1
answer
100
views
Display error validated by method in Thymeleaf
I am using Spring Data JPA to model and validate my data. In this case I got a class that got both a password and confirm field:
public class RegistrationForm {
private String password;
...
1
vote
0
answers
79
views
How to output a specific row from a H2 Database within a thymeleaf html file? The specific row based off user choice from select element
I have a H2 database with bootstrapped data, and I would like to output a specific row based off a user selection. Right now in attempting to navigate to the desired page in order to run the script ...
0
votes
0
answers
31
views
Convert textarea input separated by commas to List
I have a form and in there I got a textarea where materials should be separated by a comma.
<div class="mb-3">
<label class="form-label" for="material"&...
0
votes
0
answers
34
views
Errors passing data from Form to Controller with Thymeleaf
I am in a Java 1.8 project with Spring Boot, I have set up html page management with thymeleaf, and while the communication from Backend to Frontend works correctly, I am unable to pass data from ...
0
votes
0
answers
21
views
Thymeleaf form not saving data to database for nested objects in Spring Boot
I don't understand why the entered data from the html template is not saved in the database.
I have an entity Supplies:
@Getter
@Setter
@Builder
@AllArgsConstructor
@Entity(name = "supplies")...
-1
votes
1
answer
55
views
How to setup Thymeleaf for a web application?
Im developing a web app using eclipse and I want to use Thymeleaf, in particular I want to set from a servlet some variable to use then in an HTML file.
What I have to download to run the Thymeleaf ...
-1
votes
1
answer
30
views
Is it possible to use fragments optionally in thyemleaf?
In SpringBoot3, I made a code with fragments like this.
<body>
<div th:replace="~{fragments/header::header}"></div>
I would like to use it optionally. For example, in ...
1
vote
2
answers
50
views
Passing parameter from front-end to Controller in Spring boot
I am creating a Spring boot application for booking flights. I have a home page, where flight details are displayed in a table using thymeleaf as below:
<table border="solid">
<...
0
votes
0
answers
45
views
arabic font with itext7 and thymeleaf
i want to create an arabic pdf, but i have this problem:
my code:
FontProvider fontProvider = new DefaultFontProvider(false, false, false);
fontProvider.addFont("/police/Amiri-bold.ttf");
...
0
votes
3
answers
175
views
Validating Form Input in SpringBoot - thymeleaf
I have controller:
@Controller
@Slf4j
@RequestMapping("/natalchart")
public class NatalChartDataController {
@GetMapping({"/data"})
public String data(Model model, ...
0
votes
0
answers
30
views
404 not found error on requesting a html file defined by my springboot controller
I came across a problem developing a java springboot application.
So I have this Controller and it should map /game to a file index.html that should be loaded
@Controller
public class ViewRenderer {
...
1
vote
2
answers
165
views
springBoot + Thymeleaf: validate Email
I have this object:
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NatalChartDataPayload {
String langCode;
@NotEmpty(message = "Email cannot be empty")
@...