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 ratpack.guice.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 java.lang.StringDEFAULT_TEMPLATE_MODEstatic java.lang.StringDEFAULT_TEMPLATE_PREFIXstatic java.lang.StringDEFAULT_TEMPLATE_SUFFIX
-
Constructor Summary
Constructors Constructor Description ThymeleafModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure()java.lang.StringgetTemplatesMode()java.lang.StringgetTemplatesPrefix()java.lang.StringgetTemplatesSuffix()voidsetTemplatesMode(java.lang.String templatesMode)voidsetTemplatesPrefix(java.lang.String templatesPrefix)voidsetTemplatesSuffix(java.lang.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 java.lang.String DEFAULT_TEMPLATE_MODE
- See Also:
- Constant Field Values
-
DEFAULT_TEMPLATE_PREFIX
public static final java.lang.String DEFAULT_TEMPLATE_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_TEMPLATE_SUFFIX
public static final java.lang.String DEFAULT_TEMPLATE_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTemplatesMode
public java.lang.String getTemplatesMode()
-
getTemplatesPrefix
public java.lang.String getTemplatesPrefix()
-
getTemplatesSuffix
public java.lang.String getTemplatesSuffix()
-
setTemplatesMode
public void setTemplatesMode(java.lang.String templatesMode)
-
setTemplatesPrefix
public void setTemplatesPrefix(java.lang.String templatesPrefix)
-
setTemplatesSuffix
public void setTemplatesSuffix(java.lang.String templatesSuffix)
-
configure
protected void configure()
- Overrides:
configurein classcom.google.inject.AbstractModule
-
-