Closed northcoder-repo closed 2 years ago
@northcoder-repo I just checked our POM, and there is a comment in the Thymeleaf dependency:
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<!-- 3.1.0 is required for jakarta support -->
<!-- Ref: https://github.com/thymeleaf/thymeleaf/issues/811 -->
<version>3.1.0.M1</version>
<optional>true</optional>
</dependency>
Javalin 5 moved to Jetty 11 (which moved to Jakarta, the new servlet spec). So, you will need to use a version of Thymeleaf that supports Jakarta.
Understood - thank you.
This problem is resolved by using Thymeleaf 3.1.
I am testing a Javalin 5.0.1 "Hello world" app, using Thymeleaf 3.0.15 (latest release).
Javalin starts OK, but when I try to render my Thymeleaf template, I get a stack trace containing:
The application:
The HTML template (which happens to not have any Thymeleaf variables in it, but that does not appear to be relevant to the issue):
The Maven dependencies:
Steps to reproduce the problem:
1) Start the app (it starts cleanly):
2) In a browser, try to open
http://localhost:7070/test
.This generates the following stack trace:
The migration guide mentions:
My attempt above uses the first
init()
approach - unless I am doing it wrong.I also tried the second approach using
JavalinRender.register(...)
:This led to the same stack trace.
Am I trying to initialize Thymeleaf incorrectly?
I looked at the Javalin Thymeleaf tests, but I did not understand how these relate to the migration guide.