Class SpringStandardDialect
- Object
-
- org.thymeleaf.dialect.AbstractDialect
-
- org.thymeleaf.dialect.AbstractProcessorDialect
-
- org.thymeleaf.standard.StandardDialect
-
- org.thymeleaf.spring3.dialect.SpringStandardDialect
-
- All Implemented Interfaces:
org.thymeleaf.dialect.IDialect
,org.thymeleaf.dialect.IExecutionAttributeDialect
,org.thymeleaf.dialect.IExpressionObjectDialect
,org.thymeleaf.dialect.IProcessorDialect
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
, liketh:field
or Spring-related expression objects.The usual and recommended way of using this dialect is by instancing
SpringTemplateEngine
instead ofTemplateEngine
. 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
- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_RENDER_HIDDEN_MARKERS_BEFORE_CHECKBOXES
static String
NAME
static String
PREFIX
static int
PROCESSOR_PRECEDENCE
-
Constructor Summary
Constructors Constructor Description SpringStandardDialect()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Set<org.thymeleaf.processor.IProcessor>
createSpringStandardProcessorsSet(String dialectPrefix)
Create a the set of SpringStandard processors, all of them freshly instanced.static Set<org.thymeleaf.processor.IProcessor>
createSpringStandardProcessorsSet(String dialectPrefix, boolean renderHiddenMarkersBeforeCheckboxes)
Create a the set of SpringStandard processors, all of them freshly instanced.org.thymeleaf.standard.expression.IStandardConversionService
getConversionService()
org.thymeleaf.expression.IExpressionObjectFactory
getExpressionObjectFactory()
Set<org.thymeleaf.processor.IProcessor>
getProcessors(String dialectPrefix)
boolean
getRenderHiddenMarkersBeforeCheckboxes()
Returns whether the<input type="hidden" ...>
marker tags rendered to signal the presence of checkboxes in forms when unchecked should be rendered before the checkbox tag itself, or after (default).org.thymeleaf.standard.expression.IStandardVariableExpressionEvaluator
getVariableExpressionEvaluator()
void
setRenderHiddenMarkersBeforeCheckboxes(boolean renderHiddenMarkersBeforeCheckboxes)
Sets whether the<input type="hidden" ...>
marker tags rendered to signal the presence of checkboxes in forms when unchecked should be rendered before the checkbox tag itself, or after (default).void
setVariableExpressionEvaluator(org.thymeleaf.standard.expression.IStandardVariableExpressionEvaluator variableExpressionEvaluator)
-
Methods inherited from class org.thymeleaf.standard.StandardDialect
createStandardProcessorsSet, getCSSSerializer, getExecutionAttributes, getExpressionParser, getJavaScriptSerializer, setConversionService, setCSSSerializer, setExpressionParser, setJavaScriptSerializer
-
Methods inherited from class org.thymeleaf.dialect.AbstractProcessorDialect
getDialectProcessorPrecedence, getPrefix
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
PROCESSOR_PRECEDENCE
public static final int PROCESSOR_PRECEDENCE
- See Also:
- Constant Field Values
-
DEFAULT_RENDER_HIDDEN_MARKERS_BEFORE_CHECKBOXES
public static final boolean DEFAULT_RENDER_HIDDEN_MARKERS_BEFORE_CHECKBOXES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRenderHiddenMarkersBeforeCheckboxes
public boolean getRenderHiddenMarkersBeforeCheckboxes()
Returns whether the
<input type="hidden" ...>
marker tags rendered to signal the presence of checkboxes in forms when unchecked should be rendered before the checkbox tag itself, or after (default).A number of CSS frameworks and style guides assume that the
<label ...>
for a checkbox will appear in markup just after the<input type="checkbox" ...>
tag itself, and so the default behaviour of rendering an<input type="hidden" ...>
after the checkbox can lead to bad application of styles. By tuning this flag, developers can modify this behaviour and make the hidden tag appear before the checkbox (and thus allow the lable to truly appear right after the checkbox).Note this hidden field is introduced in order to signal the existence of the field in the form being sent, even if the checkbox is unchecked (no URL parameter is added for unchecked check boxes).
This flag is set to
false
by default.- Returns:
true
if hidden markers should be rendered before the checkboxes,false
if not.- Since:
- 3.0.10
-
setRenderHiddenMarkersBeforeCheckboxes
public void setRenderHiddenMarkersBeforeCheckboxes(boolean renderHiddenMarkersBeforeCheckboxes)
Sets whether the
<input type="hidden" ...>
marker tags rendered to signal the presence of checkboxes in forms when unchecked should be rendered before the checkbox tag itself, or after (default).A number of CSS frameworks and style guides assume that the
<label ...>
for a checkbox will appear in markup just after the<input type="checkbox" ...>
tag itself, and so the default behaviour of rendering an<input type="hidden" ...>
after the checkbox can lead to bad application of styles. By tuning this flag, developers can modify this behaviour and make the hidden tag appear before the checkbox (and thus allow the lable to truly appear right after the checkbox).Note this hidden field is introduced in order to signal the existence of the field in the form being sent, even if the checkbox is unchecked (no URL parameter is added for unchecked check boxes).
This flag is set to
false
by default.- Parameters:
renderHiddenMarkersBeforeCheckboxes
-true
if hidden markers should be rendered before the checkboxes,false
if not.- Since:
- 3.0.10
-
getVariableExpressionEvaluator
public org.thymeleaf.standard.expression.IStandardVariableExpressionEvaluator getVariableExpressionEvaluator()
- Overrides:
getVariableExpressionEvaluator
in classorg.thymeleaf.standard.StandardDialect
-
setVariableExpressionEvaluator
public void setVariableExpressionEvaluator(org.thymeleaf.standard.expression.IStandardVariableExpressionEvaluator variableExpressionEvaluator)
- Overrides:
setVariableExpressionEvaluator
in classorg.thymeleaf.standard.StandardDialect
-
getConversionService
public org.thymeleaf.standard.expression.IStandardConversionService getConversionService()
- Overrides:
getConversionService
in classorg.thymeleaf.standard.StandardDialect
-
getExpressionObjectFactory
public org.thymeleaf.expression.IExpressionObjectFactory getExpressionObjectFactory()
- Specified by:
getExpressionObjectFactory
in interfaceorg.thymeleaf.dialect.IExpressionObjectDialect
- Overrides:
getExpressionObjectFactory
in classorg.thymeleaf.standard.StandardDialect
-
getProcessors
public Set<org.thymeleaf.processor.IProcessor> getProcessors(String dialectPrefix)
- Specified by:
getProcessors
in interfaceorg.thymeleaf.dialect.IProcessorDialect
- Overrides:
getProcessors
in classorg.thymeleaf.standard.StandardDialect
-
createSpringStandardProcessorsSet
public static Set<org.thymeleaf.processor.IProcessor> createSpringStandardProcessorsSet(String dialectPrefix)
Create a the set of SpringStandard processors, all of them freshly instanced.
- Parameters:
dialectPrefix
- the prefix established for the Standard Dialect, needed for initialization- Returns:
- the set of SpringStandard processors.
-
createSpringStandardProcessorsSet
public static Set<org.thymeleaf.processor.IProcessor> createSpringStandardProcessorsSet(String dialectPrefix, boolean renderHiddenMarkersBeforeCheckboxes)
Create a the set of SpringStandard processors, all of them freshly instanced.
- Parameters:
dialectPrefix
- the prefix established for the Standard Dialect, needed for initializationrenderHiddenMarkersBeforeCheckboxes
-true
if hidden markers should be rendered before the checkboxes,false
if not.- Returns:
- the set of SpringStandard processors.
- Since:
- 3.0.10
-
-