thymeleaf-spring
thymeleaf-spring copied to clipboard
SpelExpressionParser configuration
Create a possibility to easily configure the org.springframework.expression.spel.standard.SpelExpressionParser used by SpelVariableExpressionEvaluator with a configurable SpelParserConfiguration (autoGrowNullReferences and autoGrowCollections properties) in the spring context configuration file. Currently only a parser with the standard configuration is used (autoGrowNullReferences on false and autoGrowCollections on false).
Is it possible to achieve this via a Dialect?
@sobemurray it is possible if you create a dialect that implements IExecutionAttributeDialect. The specific SpEL expression parser and evaluator are specified as execution attributes, so you can overload these with your own instances. See how they are defined at the Standard dialects here: https://github.com/thymeleaf/thymeleaf/blob/3.0-master/src/main/java/org/thymeleaf/standard/StandardDialect.java#L375-L378
IExecutionAttributeDialect is available on 3.0. How is this possible in a 2.x implementation?
@sobemurray equivalent mechanism, only in 2.1 it ilved in the IDialect interface itself: https://github.com/thymeleaf/thymeleaf/blob/thymeleaf-2.1.4.RELEASE/src/main/java/org/thymeleaf/dialect/IDialect.java#L108-L121