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
Templateinstances. Instances ofTemplatecan be created using one of theTemplate.thymeleafTemplate(String, Map)static methods.By default templates are looked up in the
thymeleafdirectory of the application root with a.htmlsuffix. SothymeleafTemplate("my/template/path")maps tothymeleaf/my/template/path.htmlin 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 classThymeleafModule.ConfigThe configuration object forThymeleafModule.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TEMPLATE_MODEstatic StringDEFAULT_TEMPLATE_PREFIXstatic StringDEFAULT_TEMPLATE_SUFFIX
-
Constructor Summary
Constructors Constructor Description ThymeleafModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure()StringgetTemplatesMode()StringgetTemplatesPrefix()StringgetTemplatesSuffix()voidsetTemplatesMode(String templatesMode)voidsetTemplatesPrefix(String templatesPrefix)voidsetTemplatesSuffix(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:
configurein classcom.google.inject.AbstractModule
-
-