@Produces(value="text/html") @Singleton public class ThymeleafViewsRenderer extends java.lang.Object implements ViewsRenderer
Modifier and Type | Field and Description |
---|---|
protected org.thymeleaf.TemplateEngine |
engine |
protected io.micronaut.core.io.ResourceLoader |
resourceLoader |
protected org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver |
templateResolver |
EXTENSION_SEPARATOR, FILE_SEPARATOR
Constructor and Description |
---|
ThymeleafViewsRenderer(org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver templateResolver,
org.thymeleaf.TemplateEngine templateEngine,
io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader) |
ThymeleafViewsRenderer(ViewsConfiguration viewsConfiguration,
ThymeleafViewsRendererConfiguration thConfiguration,
io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exists(java.lang.String viewName) |
void |
render(java.lang.String viewName,
org.thymeleaf.context.IContext context,
java.io.Writer writer)
Passes the arguments as is to
TemplateEngine.process(String, IContext, Writer) . |
io.micronaut.core.io.Writable |
render(java.lang.String viewName,
java.lang.Object data) |
io.micronaut.core.io.Writable |
render(java.lang.String viewName,
java.lang.Object data,
io.micronaut.http.HttpRequest<?> request) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
modelOf, normalizeFile, normalizeFolder
protected final org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver templateResolver
protected final org.thymeleaf.TemplateEngine engine
protected io.micronaut.core.io.ResourceLoader resourceLoader
@Deprecated public ThymeleafViewsRenderer(ViewsConfiguration viewsConfiguration, ThymeleafViewsRendererConfiguration thConfiguration, io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader)
viewsConfiguration
- Views ConfigurationthConfiguration
- Thymeleaf template renderer configurationresourceLoader
- The resource loader@Inject public ThymeleafViewsRenderer(org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver templateResolver, org.thymeleaf.TemplateEngine templateEngine, io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader)
templateResolver
- The template resolvertemplateEngine
- The template engineresourceLoader
- The resource loader@Nonnull public io.micronaut.core.io.Writable render(@Nonnull java.lang.String viewName, @Nullable java.lang.Object data)
render
in interface ViewsRenderer
viewName
- view name to be renderdata
- response body to render it with a view@Nonnull public io.micronaut.core.io.Writable render(@Nonnull java.lang.String viewName, @Nullable java.lang.Object data, @Nonnull io.micronaut.http.HttpRequest<?> request)
render
in interface ViewsRenderer
viewName
- view name to be renderdata
- response body to render it with a viewrequest
- HTTP requestpublic void render(java.lang.String viewName, org.thymeleaf.context.IContext context, java.io.Writer writer)
TemplateEngine.process(String, IContext, Writer)
.viewName
- The view namecontext
- The contextwriter
- The writerpublic boolean exists(@Nonnull java.lang.String viewName)
exists
in interface ViewsRenderer
viewName
- view name to be render