Module io.jooby.thymeleaf
Package io.jooby.thymeleaf
@NullMarked
package io.jooby.thymeleaf
Thymeleaf module: https://jooby.io/modules/thymeleaf.
Usage:
{
install(new ThymeleafModule());
get("/", ctx -> {
User user = ...;
return new ModelAndView("index.html")
.put("user", user);
});
}
The template engine looks for a file-system directory: views in the current user
directory. If the directory doesn't exist, it looks for the same directory in the project
classpath.
Template engine supports the following file extensions: .thl, .thl.html
and .html.
You can specify a different template location:
{
install(new ThymeleafModule("mypath"));
}
The mypath location works in the same way: file-system or fallback to classpath.
Direct access to TemplateEngine is available via require call:
{
TemplateEngine engine = require(TemplateEngine.class);
}
Complete documentation is available at: https://jooby.io/modules/thymeleaf.- Since:
- 2.0.0
- Author:
- edgar
-
ClassesClassDescriptionThymeleaf module: https://jooby.io/modules/thymeleaf.Utility class for creating
TemplateEngineinstances.