@Produces(value="text/html") @Singleton public class ThymeleafViewsRenderer extends Object implements ViewsRenderer
Modifier and Type | Field and Description |
---|---|
protected org.thymeleaf.TemplateEngine |
engine |
protected 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,
ClassPathResourceLoader resourceLoader) |
ThymeleafViewsRenderer(ViewsConfiguration viewsConfiguration,
ThymeleafViewsRendererConfiguration thConfiguration,
ClassPathResourceLoader resourceLoader)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exists(String viewName) |
Writable |
render(String viewName,
Object data) |
Writable |
render(String viewName,
Object data,
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 ResourceLoader resourceLoader
@Deprecated public ThymeleafViewsRenderer(ViewsConfiguration viewsConfiguration, ThymeleafViewsRendererConfiguration thConfiguration, ClassPathResourceLoader resourceLoader)
viewsConfiguration
- Views ConfigurationthConfiguration
- Thymeleaf template renderer configurationresourceLoader
- The resource loader@Inject public ThymeleafViewsRenderer(org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver templateResolver, org.thymeleaf.TemplateEngine templateEngine, ClassPathResourceLoader resourceLoader)
templateResolver
- The template resolvertemplateEngine
- The template engineresourceLoader
- The resource loader@Nonnull public Writable render(@Nonnull String viewName, @Nullable Object data)
render
in interface ViewsRenderer
viewName
- view name to be renderdata
- response body to render it with a view@Nonnull public Writable render(@Nonnull String viewName, @Nullable Object data, @Nonnull HttpRequest<?> request)
render
in interface ViewsRenderer
viewName
- view name to be renderdata
- response body to render it with a viewrequest
- HTTP requestpublic boolean exists(@Nonnull String viewName)
exists
in interface ViewsRenderer
viewName
- view name to be render