Package org.apache.juneau.rest.server.view.thymeleaf
juneau-rest-server-view-thymeleaf module.
Provides three sibling pieces that together let a Juneau REST resource render Thymeleaf templates:
ThymeleafMixin— mixin that renders raw.htmltemplates from the importer's classpath under/thymeleaf/*and auto-registersThymeleafViewRenderer.ThymeleafView— immutable value class (implements the coreViewinterface) returned from@RestOpmethods to ask the framework to render a Thymeleaf template.ThymeleafViewRenderer—ResponseProcessorthat detectsThymeleafViewreturns and dispatches them to the configuredTemplateEngineviaengine.process(templateName, context, writer).
Composition example (microservice):
Engine-agnostic packaging:
The bridge module's main POM declares only org.thymeleaf:thymeleaf in
provided scope — no concrete Thymeleaf transitive dep ships here. Consumers
add the engine matching their deployment:
- Spring Boot: add
org.springframework.boot:spring-boot-starter-thymeleaf— brings inthymeleaf+thymeleaf-spring6+ autoconfiguredSpringTemplateEngine. The bridge picks the engine up automatically viaBeanStore.getBean(TemplateEngine.class). - Juneau microservice / Jetty: add
org.thymeleaf:thymeleafdirectly. With no user-supplied engine bean, the bridge builds a defaultTemplateEngineon first request anchored on the importer's classloader. - Custom: register your own
@Bean TemplateEnginewith whatever resolvers, dialects, and template modes you need.
When no Thymeleaf engine is on the classpath, the renderer surfaces a clear diagnostic naming
the missing dependency and linking to the "Choosing a TemplateEngine" matrix in
ThymeleafViewSupport.md.
See Also:
- Since:
- 10.0.0
-
ClassesClassDescriptionFlavor-neutral worker bean carrying the Thymeleaf raw-template-dispatch logic shared by the
ThymeleafMixinmixin, theThymeleafServletservlet, and theThymeleafResourcechild flavors.Builder forThymeleafDispatcher.Mixin that wires Thymeleaf view-rendering onto any Juneau REST resource.Builder forThymeleafMixin.Child-resource flavor of theThymeleafMixinmixin.Standalone servlet companion of theThymeleafMixinmixin.Immutable value class returned from@RestOp-annotated methods to ask the framework to render a Thymeleaf template.ResponseProcessorthat detectsThymeleafView-typed return values and asks the configuredTemplateEngineto render them directly onto the response writer.