Skip to content
Advertisement

Tag: thymeleaf

How to use explicit links with Thymeleaf?

I wanted to make and link to external site in Spring+Thymeleaf web application and inserted link like this: <a th:href=”@{https://example.com}”>Link</a> However by clicking the link it tries to point internal location http://localhost/service/https://example.com not external website https://example.com like it supposed to. Site gives just an error “status”:500,”error”:”Internal Server Error”,”message”:”The request was rejected because the URL was not normalized.” What’s wrong and

How to refer to a static method in Thymeleaf html in java?

I need to use the getMoneyIntoWords() method in the invoice html. But I am getting errors. Refer the code and errors below // Added below method in MoneyUtil.java Error: Answer You need special syntax to call a static method in Thymeleaf: You will need to use the full qualified name of the MoneyUtil class.

Error resolving fragment template Spring Boot using Thymeleaf

I have a Spring Boot application using Thymeleaf, it works fine when using mvn spring-boot:run but when deploying it into the JAR file it gives me an error for all files that have th:replace statement for example templates/web/index in line: <div th:replace=”/web/includes/header :: header”></div> The exception when trying to run java -jar my-app.jar My project resources hierarchy My resources locations

Advertisement