REQ-2135: use fixed mode
This commit is contained in:
parent
5ad83c630d
commit
c7a0297354
@ -9,6 +9,8 @@ import org.springframework.expression.Expression;
|
|||||||
import org.springframework.expression.PropertyAccessor;
|
import org.springframework.expression.PropertyAccessor;
|
||||||
import org.springframework.expression.TypedValue;
|
import org.springframework.expression.TypedValue;
|
||||||
import org.springframework.expression.common.TemplateParserContext;
|
import org.springframework.expression.common.TemplateParserContext;
|
||||||
|
import org.springframework.expression.spel.SpelCompilerMode;
|
||||||
|
import org.springframework.expression.spel.SpelParserConfiguration;
|
||||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||||
import org.springframework.expression.spel.support.ReflectivePropertyAccessor;
|
import org.springframework.expression.spel.support.ReflectivePropertyAccessor;
|
||||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||||
@ -42,7 +44,9 @@ public class TemplateParser {
|
|||||||
evalContext.addPropertyAccessor(new ReflectivePropertyAccessor(false));
|
evalContext.addPropertyAccessor(new ReflectivePropertyAccessor(false));
|
||||||
evalContext.addPropertyAccessor(NullPropertyAccessor.INSTANCE);
|
evalContext.addPropertyAccessor(NullPropertyAccessor.INSTANCE);
|
||||||
TemplateParserContext templateContext = new TemplateParserContext(openToken, closeToken);
|
TemplateParserContext templateContext = new TemplateParserContext(openToken, closeToken);
|
||||||
Expression exp = new SpelExpressionParser().parseExpression(expression, templateContext);
|
SpelParserConfiguration parseCfg = new SpelParserConfiguration(
|
||||||
|
SpelCompilerMode.MIXED, TemplateParser.class.getClassLoader());
|
||||||
|
Expression exp = new SpelExpressionParser(parseCfg).parseExpression(expression, templateContext);
|
||||||
exp.getValue(evalContext, String.class);
|
exp.getValue(evalContext, String.class);
|
||||||
Object value = exp.getValue(evalContext);
|
Object value = exp.getValue(evalContext);
|
||||||
if (value == null)
|
if (value == null)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user