Interface ISpringTemplateEngine

All Superinterfaces:
org.thymeleaf.ITemplateEngine
All Known Subinterfaces:
ISpringWebFluxTemplateEngine
All Known Implementing Classes:
SpringTemplateEngine, SpringWebFluxTemplateEngine

public interface ISpringTemplateEngine extends org.thymeleaf.ITemplateEngine

Sub-interface of ITemplateEngine meant for Spring applications, meant to be using the SpringStandardDialect and integrating with other Spring-bound infrastructure.

The SpringTemplateEngine implementation of this interface (or a subclass) should be used in almost every case, but this interface improves testability of these artifacts.

Since:
3.0.3
Author:
Daniel Fernández
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the classes that will be allowed to be used in SpEL expressions in views, explicitly overriding the standard set of forbidden classes.
    void
    setAllowedClassOverridesForViews(Collection<Class<?>> allowedClassOverridesForViews)
    Sets the collection of classes that will be explicitly allowed to be used in SpEL expressions in views, overriding the standard set of forbidden classes.
    void
    setTemplateEngineMessageSource(org.springframework.context.MessageSource templateEngineMessageSource)
    Sets the Spring MessageSource to be used for this template engine.

    Methods inherited from interface org.thymeleaf.ITemplateEngine

    getConfiguration, process, process, process, process, process, process, processThrottled, processThrottled, processThrottled
  • Method Details

    • setTemplateEngineMessageSource

      void setTemplateEngineMessageSource(org.springframework.context.MessageSource templateEngineMessageSource)

      Sets the Spring MessageSource to be used for this template engine.

      Note that the SpringTemplateEngine implementation will allow this to be set automatically by implementing the MessageSourceAware interface, but in such case this method will allow to override this mechanism if needed.

      Parameters:
      templateEngineMessageSource - the message source to be used by the message resolver.
    • getAllowedClassOverridesForViews

      Collection<Class<?>> getAllowedClassOverridesForViews()

      Returns the classes that will be allowed to be used in SpEL expressions in views, explicitly overriding the standard set of forbidden classes.

      Returns:
      the classes that will be allowed to be used in expressions in views even if forbidden by default.
      Since:
      3.1.4
    • setAllowedClassOverridesForViews

      void setAllowedClassOverridesForViews(Collection<Class<?>> allowedClassOverridesForViews)

      Sets the collection of classes that will be explicitly allowed to be used in SpEL expressions in views, overriding the standard set of forbidden classes.

      Parameters:
      allowedClassOverridesForViews - a collection of Class<?> instances representing the classes to be allowed in expressions within views.
      Since:
      3.1.4