public class SpringStandardDialect
extends org.thymeleaf.standard.StandardDialect
SpringStandard Dialect. This is the class containing the implementation of Thymeleaf Standard Dialect, including all th:* processors, expression objects, etc. for Spring-enabled environments.
Note this dialect uses SpringEL as an expression language and adds some Spring-specific
features on top of StandardDialect
, like th:field or Spring-related expression objects.
The usual and recommended way of using this dialect is by instancing SpringTemplateEngine
instead of TemplateEngine
. The former will automatically add this dialect and perform
some specific configuration like e.g. Spring-integrated message resolution.
Note a class with this name existed since 1.0, but it was completely reimplemented in Thymeleaf 3.0
Modifier and Type | Field and Description |
---|---|
static String |
NAME |
static String |
PREFIX |
static int |
PROCESSOR_PRECEDENCE |
Constructor and Description |
---|
SpringStandardDialect() |
Modifier and Type | Method and Description |
---|---|
static Set<org.thymeleaf.processor.IProcessor> |
createSpringStandardProcessorsSet(String dialectPrefix)
Create a the set of SpringStandard processors, all of them freshly instanced.
|
org.thymeleaf.standard.expression.IStandardConversionService |
getConversionService() |
boolean |
getEnableSpringELCompiler()
Returns whether the SpringEL compiler should be enabled in SpringEL expressions or not.
|
Map<String,Object> |
getExecutionAttributes() |
org.thymeleaf.expression.IExpressionObjectFactory |
getExpressionObjectFactory() |
Set<org.thymeleaf.processor.IProcessor> |
getProcessors(String dialectPrefix) |
org.thymeleaf.standard.expression.IStandardVariableExpressionEvaluator |
getVariableExpressionEvaluator() |
void |
setEnableSpringELCompiler(boolean enableSpringELCompiler)
Sets whether the SpringEL compiler should be enabled in SpringEL expressions or not.
|
createStandardProcessorsSet, getCSSSerializer, getExpressionParser, getJavaScriptSerializer, setConversionService, setCSSSerializer, setExpressionParser, setJavaScriptSerializer, setVariableExpressionEvaluator
getDialectProcessorPrecedence, getPrefix
public static final String NAME
public static final String PREFIX
public static final int PROCESSOR_PRECEDENCE
public boolean getEnableSpringELCompiler()
Returns whether the SpringEL compiler should be enabled in SpringEL expressions or not.
Expression compilation can significantly improve the performance of Spring EL expressions, but might not be adequate for every environment. Read the official Spring documentation for more detail.
Also note that although Spring includes a SpEL compiler since Spring 4.1, most expressions in Thymeleaf templates will only be able to properly benefit from this compilation step when at least Spring Framework version 4.2.4 is used.
This flag is set to false by default.
public void setEnableSpringELCompiler(boolean enableSpringELCompiler)
Sets whether the SpringEL compiler should be enabled in SpringEL expressions or not.
Expression compilation can significantly improve the performance of Spring EL expressions, but might not be adequate for every environment. Read the official Spring documentation for more detail.
Also note that although Spring includes a SpEL compiler since Spring 4.1, most expressions in Thymeleaf templates will only be able to properly benefit from this compilation step when at least Spring Framework version 4.2.4 is used.
This flag is set to false by default.
enableSpringELCompiler
- true if SpEL expressions should be compiled if possible, false if not.public org.thymeleaf.standard.expression.IStandardVariableExpressionEvaluator getVariableExpressionEvaluator()
getVariableExpressionEvaluator
in class org.thymeleaf.standard.StandardDialect
public org.thymeleaf.standard.expression.IStandardConversionService getConversionService()
getConversionService
in class org.thymeleaf.standard.StandardDialect
public org.thymeleaf.expression.IExpressionObjectFactory getExpressionObjectFactory()
getExpressionObjectFactory
in interface org.thymeleaf.dialect.IExpressionObjectDialect
getExpressionObjectFactory
in class org.thymeleaf.standard.StandardDialect
public Set<org.thymeleaf.processor.IProcessor> getProcessors(String dialectPrefix)
getProcessors
in interface org.thymeleaf.dialect.IProcessorDialect
getProcessors
in class org.thymeleaf.standard.StandardDialect
public Map<String,Object> getExecutionAttributes()
getExecutionAttributes
in interface org.thymeleaf.dialect.IExecutionAttributeDialect
getExecutionAttributes
in class org.thymeleaf.standard.StandardDialect
public static Set<org.thymeleaf.processor.IProcessor> createSpringStandardProcessorsSet(String dialectPrefix)
Create a the set of SpringStandard processors, all of them freshly instanced.
dialectPrefix
- the prefix established for the Standard Dialect, needed for initializationCopyright © 2016 The THYMELEAF team. All rights reserved.