Package ratpack.thymeleaf3
Class ThymeleafModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- ratpack.guice.ConfigurableModule<ThymeleafModule.Config>
-
- ratpack.thymeleaf3.ThymeleafModule
-
- All Implemented Interfaces:
com.google.inject.Module
public final class ThymeleafModule extends ConfigurableModule<ThymeleafModule.Config>
An extension module that provides support for Thymeleaf templating engine.To use it one has to register the module and then render
Template
instances. Instances ofTemplate
can be created using one of theTemplate.thymeleafTemplate(String, Map)
static methods.By default templates are looked up in the
thymeleaf
directory of the application root with a.html
suffix. SothymeleafTemplate("my/template/path")
maps tothymeleaf/my/template/path.html
in the application root directory. This can be configured usingsetTemplatesPrefix(String)
andsetTemplatesSuffix(String)
as well as configuration ofThymeleafModule.Config.templatesPrefix(String)
andThymeleafModule.Config.templateSuffix(String)
.- See Also:
- Thymeleaf
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThymeleafModule.Config
The configuration object forThymeleafModule
.
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_TEMPLATE_MODE
static String
DEFAULT_TEMPLATE_PREFIX
static String
DEFAULT_TEMPLATE_SUFFIX
-
Constructor Summary
Constructors Constructor Description ThymeleafModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure()
String
getTemplatesMode()
String
getTemplatesPrefix()
String
getTemplatesSuffix()
void
setTemplatesMode(String templatesMode)
void
setTemplatesPrefix(String templatesPrefix)
void
setTemplatesSuffix(String templatesSuffix)
-
Methods inherited from class ratpack.guice.ConfigurableModule
configure, createConfig, defaultConfig, setConfig
-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Field Detail
-
DEFAULT_TEMPLATE_MODE
public static final String DEFAULT_TEMPLATE_MODE
- See Also:
- Constant Field Values
-
DEFAULT_TEMPLATE_PREFIX
public static final String DEFAULT_TEMPLATE_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_TEMPLATE_SUFFIX
public static final String DEFAULT_TEMPLATE_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTemplatesMode
public String getTemplatesMode()
-
getTemplatesPrefix
public String getTemplatesPrefix()
-
getTemplatesSuffix
public String getTemplatesSuffix()
-
setTemplatesMode
public void setTemplatesMode(String templatesMode)
-
setTemplatesPrefix
public void setTemplatesPrefix(String templatesPrefix)
-
setTemplatesSuffix
public void setTemplatesSuffix(String templatesSuffix)
-
configure
protected void configure()
- Overrides:
configure
in classcom.google.inject.AbstractModule
-
-