Package org.thymeleaf.templateresolver
Class ServletContextTemplateResolver
- Object
-
- org.thymeleaf.templateresolver.AbstractTemplateResolver
-
- org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver
-
- org.thymeleaf.templateresolver.ServletContextTemplateResolver
-
- All Implemented Interfaces:
ITemplateResolver
public class ServletContextTemplateResolver extends AbstractConfigurableTemplateResolver
Implementation of
ITemplateResolver
that extendsAbstractConfigurableTemplateResolver
and createsServletContextTemplateResource
instances for template resources.Note a class with this name existed since 1.0, but it was completely rewritten in Thymeleaf 3.0.
- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
-
Field Summary
-
Fields inherited from class org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver
DEFAULT_CACHE_TTL_MS, DEFAULT_CACHEABLE, DEFAULT_TEMPLATE_MODE
-
Fields inherited from class org.thymeleaf.templateresolver.AbstractTemplateResolver
DEFAULT_EXISTENCE_CHECK, DEFAULT_USE_DECOUPLED_LOGIC
-
-
Constructor Summary
Constructors Constructor Description ServletContextTemplateResolver(javax.servlet.ServletContext servletContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ITemplateResource
computeTemplateResource(IEngineConfiguration configuration, String ownerTemplate, String template, String resourceName, String characterEncoding, Map<String,Object> templateResolutionAttributes)
Compute the real resource, once the resource name has been computed using prefix, suffix, and other configured artifacts.-
Methods inherited from class org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver
addTemplateAlias, clearTemplateAliases, computeResourceName, computeResourceName, computeTemplateMode, computeTemplateResource, computeValidity, getCacheablePatterns, getCacheablePatternSpec, getCacheTTLMs, getCharacterEncoding, getCSSTemplateModePatterns, getCSSTemplateModePatternSpec, getForceSuffix, getForceTemplateMode, getHtml5TemplateModePatterns, getHtml5TemplateModePatternSpec, getHtmlTemplateModePatterns, getHtmlTemplateModePatternSpec, getJavaScriptTemplateModePatterns, getJavaScriptTemplateModePatternSpec, getLegacyHtml5TemplateModePatterns, getLegacyHtml5TemplateModePatternSpec, getNonCacheablePatterns, getNonCacheablePatternSpec, getPrefix, getRawTemplateModePatterns, getRawTemplateModePatternSpec, getSuffix, getTemplateAliases, getTemplateMode, getTextTemplateModePatterns, getTextTemplateModePatternSpec, getValidXhtmlTemplateModePatterns, getValidXhtmlTemplateModePatternSpec, getValidXmlTemplateModePatterns, getValidXmlTemplateModePatternSpec, getXhtmlTemplateModePatterns, getXhtmlTemplateModePatternSpec, getXmlTemplateModePatterns, getXmlTemplateModePatternSpec, isCacheable, setCacheable, setCacheablePatterns, setCacheTTLMs, setCharacterEncoding, setCSSTemplateModePatterns, setForceSuffix, setForceTemplateMode, setHtml5TemplateModePatterns, setHtmlTemplateModePatterns, setJavaScriptTemplateModePatterns, setLegacyHtml5TemplateModePatterns, setNonCacheablePatterns, setPrefix, setRawTemplateModePatterns, setSuffix, setTemplateAliases, setTemplateMode, setTemplateMode, setTextTemplateModePatterns, setValidXhtmlTemplateModePatterns, setValidXmlTemplateModePatterns, setXhtmlTemplateModePatterns, setXmlTemplateModePatterns
-
Methods inherited from class org.thymeleaf.templateresolver.AbstractTemplateResolver
computeResolvable, getCheckExistence, getName, getOrder, getResolvablePatterns, getResolvablePatternSpec, getUseDecoupledLogic, resolveTemplate, setCheckExistence, setName, setOrder, setResolvablePatterns, setUseDecoupledLogic
-
-
-
-
Method Detail
-
computeTemplateResource
protected ITemplateResource computeTemplateResource(IEngineConfiguration configuration, String ownerTemplate, String template, String resourceName, String characterEncoding, Map<String,Object> templateResolutionAttributes)
Description copied from class:AbstractConfigurableTemplateResolver
Compute the real resource, once the resource name has been computed using prefix, suffix, and other configured artifacts.
- Specified by:
computeTemplateResource
in classAbstractConfigurableTemplateResolver
- Parameters:
configuration
- the engine configuration in use.ownerTemplate
- the owner template, if the resource being computed is a fragment. Might be null.template
- the template (normally the template name, except for String templates).resourceName
- the resource name, complete with prefix, suffix, aliases, etc.characterEncoding
- the character encoding to be used for reading the resource.templateResolutionAttributes
- the template resolution attributes, if any. Might be null.- Returns:
- the template resource
-
-