Class SpringResourceTemplateResolver

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.thymeleaf.templateresolver.ITemplateResolver

    public class SpringResourceTemplateResolver
    extends org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver
    implements org.springframework.context.ApplicationContextAware

    Implementation of ITemplateResolver that extends AbstractConfigurableTemplateResolver and resolves templates using Spring's Resource Resolution mechanism (see ResourceLoader.getResource(String)).

    Since:
    3.0.3
    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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.thymeleaf.templateresource.ITemplateResource computeTemplateResource​(org.thymeleaf.IEngineConfiguration configuration, String ownerTemplate, String template, String resourceName, String characterEncoding, Map<String,​Object> templateResolutionAttributes)  
      void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
      • 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
    • Constructor Detail

      • SpringResourceTemplateResolver

        public SpringResourceTemplateResolver()
    • Method Detail

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • computeTemplateResource

        protected org.thymeleaf.templateresource.ITemplateResource computeTemplateResource​(org.thymeleaf.IEngineConfiguration configuration,
                                                                                           String ownerTemplate,
                                                                                           String template,
                                                                                           String resourceName,
                                                                                           String characterEncoding,
                                                                                           Map<String,​Object> templateResolutionAttributes)
        Specified by:
        computeTemplateResource in class org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver