Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 : ...
user avatar
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,&lt;br&gt;...
Unknown User's user avatar
0 votes
0 answers
41 views

Problem loading internal css with Spring Security 6 and Thymeleaf

My code below, login page doesn't load css resources, if I disable Spring Security it loads: \\src\\main\\resources\\static\\assets\\css\\login.css @Configuration @EnableWebSecurity public class ...
Rodrigo's user avatar
  • 39
0 votes
0 answers
27 views

why background image is not working in themleaf

I tried with CSS to set the background image but not working in thymeleaf I also tried with the body attribute background Still not working.. body{ background-image: url(images/uomback....
KunaRakeshKumar's user avatar
1 vote
2 answers
615 views

Spring Boot Thymeleaf not recognizing CSS file

The problem is that a thymeleaf does not find my css file Project structure enter image description here I am able to access css file with given url http://localhost:8080/styles.css I use spring boot ...
maniek's user avatar
  • 13
0 votes
1 answer
107 views

How can i use css file in java/spring thymeleaf

Hi, I have an html(footer) file and a css(webflow) file. But I can't use my css file. This my conf class @Configuration @EnableWebMvc public class WebConfig implements WebMvcConfigurer { @Override ...
emiirhaneksi's user avatar
0 votes
2 answers
67 views

How to show colour change when customised radio button is selected?

I am new to coding generally, and have been working on a quiz program on HTML and CSS (data is from PostgreSQL, framework SpringBoot on Eclipse. PHP and JQuery not included in syllabus). Here's my ...
reinbowpuke's user avatar
0 votes
1 answer
149 views

Spring Thymeleaf not processing field properly?

I have an Author class which extends BaseEntity superclass. In the template I'm trying to get a boolean property from the author variable so that I can reuse the form for Create and Update. Can ...
MikesMikes's user avatar
0 votes
0 answers
209 views

Pseudo-element :after not working anymore after upgrading 'openhtmltopdf' to v1.0.10

I'm working on a project, where we use thymeleaf to design .html files. These are being transformed to pdf using danfickles pure-Java library. Because the framework doesn't support CSS3 features, one ...
Ayume's user avatar
  • 21
0 votes
1 answer
668 views

Thymeleaf and html css with flying saucer doesn't work with packaged jar

I have a thymeleaf html template with custom css styling and a 'flying saucer' to produce the pdf and download from the GET REST endpoint. Here is the project folder structure of the project with ...
tyro's user avatar
  • 617
1 vote
1 answer
84 views

CSS File not loading on different url

I have two endpoints each of them is returning the "index.html" view. http://localhost:8080/ this URL shows the index file and CSS is working as well. image http://localhost:8080/product/1 ...
Aman Agarwal's user avatar
0 votes
0 answers
524 views

How to use Thymeleaf Fragment and Replace tags to insert css inside html file

I need to insert these code every html in the folder, so am trying to insert it inside head tag using thymeleaf: <link rel="stylesheet" href="../static/assets/css/plugins.css"&...
JamesB's user avatar
  • 499
0 votes
1 answer
173 views

I have a Table which is so wide to an A4 paper size and i want this Table to be vertical in HTML [duplicate]

I have a table like this A header Another header A1 B1 A2 B2 A3 B3 I want it to be like this A header A1 A2 Another header B1 B2 Another header C1 C2 I'm working with Thymeleaf, so if I use ...
Ahmad Naser AlMuhtar's user avatar
0 votes
0 answers
19 views

Css doesnt work with ReloadableResourceBundleMessageSource

im working with Spring Framework and Thymeleaf. I put to my project validation.properties. When I used method which has connect with validation.properties always I got errors so i found method which ...
Patient Zero's user avatar
0 votes
2 answers
1k views

How can I display a products star rating based on a variable/user input?

I am looking for a way to display a star rating using Spring Boot/Java without using a set value. I am able to display star ratings if I know the value I want to display, but if it is a changing ...
Jlarkin's user avatar
  • 29
0 votes
1 answer
812 views

How to change color for links (href text) in thymeleaf?

I have the below link(href) in Thymeleaf page. <div class="product-preview-container" th:each="prodInfo : ${products}"> <ul> <li>Product Code: &...
Som's user avatar
  • 1,618
0 votes
3 answers
496 views

how to get the result of database in thymleaf horizontally (4 records in a row)

Please, someone, help me to get the result of the database(MySQL) in thymleaf horizontally (4 records in each row) and then next line again 4 rows. when I add a new product it will again add result in ...
Shivkumar Dubey's user avatar
1 vote
1 answer
576 views

How to set the CSS with Spring Boot and Thymeleaf

I've been trying to make my css file work with Spring Boot and Thymeleaf (or even without Thymeleaf) but its not working at all. I've checked many answers on StackOverFlow, tried everything, but its ...
purenoob's user avatar
2 votes
2 answers
1k views

Fix location path to .css with Thymeleaf (Spring Boot)

I'm working on a project with Spring Boot. I have a main.css file under /src/main/resources/static/css/ I use this thymeleaf code to inject the .css file into a .html file from the /templates folder: &...
tibotka's user avatar
  • 154
1 vote
0 answers
39 views

Stylesheet is not added when rendering whitelisted paths

Can't figure out how to get my stylesheet to display for the homepage when I added WebApplicationConfig Class and AuthenticationFilter Class. My style she is located at resources/static/css. My ...
Carol Connor's user avatar
1 vote
1 answer
2k views

Spring Boot + Thymeleaf + Flying Saucer imported css not working

I don't understand why css is not working (I already followed what is said on this thread) I have the following file structure for my ressources : resources - static -style ...
Ombrelin's user avatar
  • 667
0 votes
1 answer
135 views

Java. Thymeleaf. After CRUD operation all .CSS styles on page disappearing

A have simple CRUD web application. And I want to bind UI and backend with thymeleaf. After I create some data and get server response - all styles are disappearing. I'm new to thymeleaf, CSS and HTML....
Mytap's user avatar
  • 203
-1 votes
1 answer
420 views

How to load load CSS Styles in Spring Boot project?

In template directory I have index.html with link on static/css/style.css. Browser not loading styles. Same code in other static project without spring works fine. Why? What should I do to load css ...
andrew17's user avatar
  • 925
0 votes
1 answer
717 views

How to use th:classapend if a form error on another field exists?

Using Thymeleaf, I want to append a CSS class to a div in a row if a specific error div (reserved for a form input error) is not visible. I'm using Bootstrap 4, and it's grid system. I tried some ...
artpropp's user avatar
0 votes
1 answer
198 views

How to add <i class="something"></i> in Thymeleaf problem with quotes

Spring on Tomcat : I want to add icon name for example : <div class="weatherIcon"><i class="wi-night-sleet"></i></div> from http://erikflowers.github.io/weather-icons/. ...
Grafik Krystian's user avatar
0 votes
1 answer
1k views

Thymeleaf static images not being found

I've just added a bootstrap template to the app I'm working on and have been the process of making it, and Thymeleaf like each other. I'm unable to serve up the images when I head off to different ...
null's user avatar
  • 3,517
0 votes
0 answers
249 views

Using Thymeleaf to dynamically generate link tags for CSS files in folder

Is it possible to have Thymeleaf dynamically generate a list of CSS <link> tags for all CSS files in a folder? For example, if I have a folder: src/main/resource/static/css with aaa.css and ...
NatFar's user avatar
  • 2,220
0 votes
1 answer
747 views

Sprint MVC App using Thymeleaf Unable to find CSS with standard href?

I'm having some problems trying with path structure in a MVC app. There were some similar older questions on this site, but none that resolved or explained my question. This is the href I am using ...
K13's user avatar
  • 314
0 votes
0 answers
723 views

Spring Thymeleaf classappend not appending the classes

I'm trying to classappend a few classes dependant on errors found in the validation process of a form. But for some reason, it's not appending the classes. My CSS is correct as it works without using ...
Daniel's user avatar
  • 125
1 vote
1 answer
68 views

does not display css content through thymeleaf

i have css files: main.css h1 { color: red; } index.html <!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <meta http-equiv="Content-Type" content="text/...
Emil's user avatar
  • 77
0 votes
1 answer
95 views

does not display div content

I wanted to make a web application, so I started with creating the look. My frontend is poor so I wanted to use ready templates such as bootstrap navbar. I use thymeleaf additionally. I copied the ...
Emil's user avatar
  • 77
0 votes
0 answers
263 views

onclick not working on thymleaf <a> tag enclosed in <li>, it works in <div>

I am trying to build a spring mvc application with thymeleaf. I am using anchor tag inside list when user clicks on anchor tag it should trigger an onclick event but it is not triggering. When I ...
Avi's user avatar
  • 9
-1 votes
2 answers
79 views

Spring can not load CSS

Hello I have a little problem, when i'm starting my Spring boot web app, when i'm going to my localhost it cant load CSS. I figured out that it's happening after adding "@ComponentScan" into Main ...
Carlton Leatch's user avatar
2 votes
2 answers
2k views

Spring, Thymeleaf with CSS how to color the errors

So, I have this: <td th:if="${#fields.hasErrors('teacher.name')}" th:errors="*{teacher.name}">Name Error</td> It works, it prints out the desired message on the screen, but how to color ...
mdenci's user avatar
  • 307
8 votes
2 answers
2k views

Site resources leaks into UUID in GetMapping

I have researched this issue a lot and I did not manage to find anyone mentioning anything similar. I am creating a spring boot app and using GetMapping to map my resources. For some reason, I am ...
kkflf's user avatar
  • 2,570
0 votes
1 answer
2k views

How do I include my css file, while using Java and Spring with thymeleaf?

I have tried different apporaches. For me, most logical would be the standard way, as I have it now in my "Item.html": <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"...
Riku 's user avatar
  • 157
2 votes
3 answers
2k views

The .css file turns to become an HTML (thymeleaf) where it was embedded to

This is weird but it looks like Spring has just turned the bootstrap.css file into the thymeleaf .html template. Just take a look at the screenshot: Can anyone explain me why this has happened and ...
Václav's user avatar
  • 460
0 votes
2 answers
592 views

Can't reach link th:src route on thymeleaf

Well, that's nothing more, tried everything, googled and still unsolving this tricky problem, I'll be glad if you can help me with this! Here you can see how it looks; Here is the css code; <...
Michael Perez's user avatar
1 vote
1 answer
5k views

Thymeleaf: how to make table with different colors

Could somebody say how to make table with different colors using Thymeleaf? I have a list of events with integer value of risk weight. And I need to colorize the html column (choose class) by ...
Eugene Shamkin's user avatar
0 votes
1 answer
12k views

Include header and footer using Spring boot and thymeleaf on html file on hierarchical folder append hierarchy on the CSS link on head tag?

I have include the header and footer as fragments for the html using Spring Boot and Thymeleaf. The header and footer works fine for the index.html but doesn't work for the other *.html pages which ...
Kabindra Shrestha's user avatar
0 votes
1 answer
237 views

Checkbox - CSS effect not working

I have a problem that I can not solve. I want to do this effect: Click http://codepen.io/siiron/pen/MYXZWg Passing data from the view to the controller works fine, the data after clicking the ...
dsp's user avatar
  • 15
0 votes
1 answer
257 views

Spring CSS sometimes loading bootstrap but not my CSS

I'm having quite a mistery and I have no idea where to start searching or what for. Problem is that my edit page for selected item does not load css, while practically same page for adding the same ...
Brns's user avatar
  • 51
5 votes
3 answers
1k views

Thymeleaf inside [if mso]

I am working on an email template using spring thymeleaf. I need to include a check for MS-outlook [if mso] inside my template. I need to set a variable inside the block. I was wondering if there is a ...
Nimesh Mishra's user avatar
0 votes
2 answers
586 views

ThymeLeaf selection a specific enum type

package com.newconstructs.controller.home; import com.newconstructs.domain.Animal; import com.newconstructs.domain.api.Layout; import com.newconstructs.service.api.AnimalService; import org....
SBFrost's user avatar
1 vote
0 answers
1k views

Thymeleaf 3 + Spring 4 - Exception processing template, what's going on?

I'm working on a new app using Spring 4 and Thymeleaf 3. My LoginController.java has the following mapping: @RequestMapping(value = { "/", "/home", "/welcome" }, method = RequestMethod.GET) public ...
gtludwig's user avatar
  • 5,591
0 votes
1 answer
3k views

How to add static files using Spring MVC and Thymeleaf

My question is how to add static files like CSS and image files so that I can use them. I am using Spring MVC and Thymeleaf. I looked at various posts on this subject, but they did't help me, so I am ...
user5139637's user avatar
1 vote
2 answers
2k views

Static files can not found Spring MVC + Thymeleaf

I have a spring application which is a starting project. I used Thymeleaf as template engine. But i have problem which is i can not reach to the static files such as CSS or javascript. This is my file ...
Abdullah Tellioglu's user avatar
120 votes
10 answers
160k views

Thymeleaf: how to use conditionals to dynamically add/remove a CSS class

By using Thymeleaf as template engine, is it possible to add/remove dynamically a CSS class to/from a simple div with the th:if clause? Normally, I could use the conditional clause as follows: <a ...
vdenotaris's user avatar
  • 13.6k