9,316 questions
0
votes
1
answer
44
views
How do I fetch an API and display it on a custom Error 404 Page?
I'm trying to build a custom error 404 page that displays a random Chuck Norris joke on it, but even though typing in the wrong URL makes the error page show up, Thymeleaf doesn't render the Chuck ...
-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
20
views
How will variables be rendered that weren't declared?
I am trying some Spring MVC stuff, and the template engine is Thymeleaf.
In my view, there is
<p th:text="${message}"></p>
But when first accessing to this view, the message ...
0
votes
0
answers
13
views
404 Error When Loading CSS Styles in a Spring Boot Application with Thymeleaf
Problem Description
I am developing a web application using Spring Boot and Thymeleaf. I have moved my CSS styles to the static folder and configured my project to serve static resources. However, ...
0
votes
1
answer
27
views
How to filter a collection in thymeleaf th:each according to a Date
folks... I have a problem filtering a date in a th:each iteration. I populate a List like that:
List<Date> days = new ArrayList<>();
days.add( new Date(2024,11,10) );
days....
0
votes
1
answer
25
views
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'description' available as request attribute
I am getting the error:
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'description' available as request attribute.
Could you help me correct this error?...
0
votes
1
answer
23
views
Using thymeleaf, how to check a row in a table based on another pre-existing list?
folks...
Using Thymeleaf, it's possible to do something like that?
<tr th:each="body : ${bodies}" >
<td><input type="checkbox" th:value="${body.id}"
...
0
votes
0
answers
27
views
How to Render Validation Messages from DTO in Thymeleaf View?
I am working on a Spring Boot project where I want to display validation error messages defined in my DTO directly on the view using Thymeleaf, especially the "content" field. While the ...
0
votes
1
answer
25
views
Can i use input fragments in forms with Thymeleaf?
Please excuse me if this question already exists. But unfortunately I can't find anything about it.
I would like to move the form into a fragment so that the layout always remains the same.
But ...
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
0
answers
18
views
access spring bean into thymeleaf template outside controller [duplicate]
I use thymeleaf in spring to generate html, but outside controller like that:
@Service
class Generator(private val templateEngine: SpringTemplateEngine) {
fun generate() : String = templateEngine....
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
1
answer
16
views
Thymeleaf and macro substitution
folks...
Can I do something like this using Thymeleaf?
<tr th:each="row : ${list}">
<td th:each="field : ${arrayFieldName}" scope="row">
<span ...
0
votes
0
answers
45
views
Link base "/assets/css/style.css" cannot be context relative (/...)
A ton of questions have been asked about connecting Thymeleaf + CSS and Spring Boot. I could not find any that addressed this problem with Ktor.
I have this template:
<!DOCTYPE html>
<html ...
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
19
views
Dividing data to show in separate rows in thymeleaf
I am trying to generate a table in thymeleaf with data coming from a springboot backend.summaryList is List objects where SummaryDTO has aliquotID,ic50,fold,refID,ic50_ref attributes.
My requirement ...
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
0
answers
8
views
Using thymeleaf-extras-springsecurity to expose OIDC UserInfo
I am trying to use the sec: tag to display fields from UserInfo in Spring Boot (3.3.5). I've included the dependency for thymeleaf-extras-springsecurity6 and the xmlns:sec. This works:
<div ...
0
votes
1
answer
125
views
Using SpringBoot, thymeleaf and htmx specifically with hx-put in a html form th:object not being passed in request
I am attempting to use hx-put for processing an update on a form. My project uses Spring 3.3.2, thymeleaf-extras-springsecurity6, and htmx 2.0.3 (webjars).
Here is my thymeleaf fragment for processing ...
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
0
answers
34
views
Blank Page when running a project using Spring Boot + Thymeleaf
I have a SpringBoot Intializr project that consists of a Tech Shop using HTML and Bootstrap. However when I run it , I get a blank page. I have attempted to change the port , change the JDK version (...
0
votes
1
answer
42
views
How to avoid the automatic redirection to the login page after the registration page but redirect to the authentication for submitting the pin?
# I am using Java 21,
# Spring boot 3.3.4,
# Spring security.
#
***The process is :
form register --> save userEntity credentials and also save a tokenEntity for authentication.
I send mail with ...
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
0
answers
16
views
Receive data from radio input group per POST with thymeleaf
Here’s your translated text:
Basically, I have this form:
Picture of the form
<form method="post" th:action="@{/solution-add}">
<input type="hidden" th:name=...
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
36
views
CAS login page with select2 for sources
In our CAS configuration, we have a lot of authentication sources. So, on this page, it will be useful for the user to search and select sources using a method like select2.
How to modify loginform....
-1
votes
1
answer
135
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
33
views
Authorization test with spring-boot security and thymeleaf controller
I have a method in my controller that just allow user with ADMIN role, and want to do a test for it (*I'm using thymeleaf)
This is my controller method:
@GetMapping("/admin")
public String ...
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
20
views
Bootstap Dropdown List of list - Why child list click close parent list?
I have two lists of data Parent list another each parent has a list of child data. After clicking parent child opened then incide any where on child the parent closed. I found found any answer. I am ...
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
vote
1
answer
34
views
Thymeleaf syntax for the form action
I have this form:
<body>
<h1>Fill out the form</h1>
<form action="@{/submit}" method="post" th:object="${person}">
<span th:if="${#...
0
votes
1
answer
96
views
Adding Form Inputs Dynamically with Javascript and Thymeleaf
I'm wondering what is the most idiomatic/optimal solution is for adding form elements dynamically with Javascript and Thymeleaf. For context, I have a form that is being generated server side like so:
...
-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
42
views
Thymeleaf recursive fragment fails at runtime with source is null for getProperty
I want to create a recursive template with Thymeleaf 3.1.2. (The full code is below).
I have a recursive Node class:
public static class Node {
public String description2;
public List<Node&...
0
votes
0
answers
28
views
could not able to load the index.html page with Spring boot thymeleaf application?
i'm facing 404 Error when i deploy Spring and thymeleaf project into tomcat
Error
I need to able to get load the index page when I start the application
in Spring boot application webApp is not ...
0
votes
0
answers
31
views
Is it possible to automatically generate and persist a static html file out of Thymeleaf template in maven?
I have a Spring Boot app with a Thymeleaf template (i.e. resources\templates\index.html), which is served as the app home page.
Some while ago, I decided to host the home page outside of the app i.e. ...
0
votes
0
answers
34
views
How can I overwrite inputs name attribute when thymeleaf automatically sets it when using th:field
In my thymeleaf template there is a form in which there is a radio button.
Looks like thymeleaf automatically gives a name to input name attribute.
This is the code:
<div>
<table th:each=&...
0
votes
1
answer
25
views
How to map nested arrays in thymeleaf
This is my code:
My classes:
public class Persons {
List<Student> students;
}
public class Student {
List<String> role;
}
In thymeleaf:
<select id="role" tabindex=&...
1
vote
1
answer
49
views
How to write Thymeleaf code inside of text?
I have a tasks and comments in every task. I use accordion to expand comment section, but problem is when i open One comment section opens all comments.
So in JAVA EE I solved this like that:
<...
0
votes
1
answer
43
views
Spring thymeleaf display month name from month number
I have an Integer for month in the DTO class. While displaying on thymeleaf template, I just want it to be month name in string like 'January' for integer value 0, and so on. I checked #dates but ...