SPEL表达式解析

  • 380 字
  • null 次阅读
  • null 条评论

SPEL表达式解析

1
2
3
4
5
6
7
8
StandardEvaluationContext context = new StandardEvaluationContext();
context.setVariable("DEPT1", "3333");
context.setVariable("DEPT2", "444411");
ExpressionParser parser = new SpelExpressionParser();

Expression expression = parser.parseExpression("#DEPT3 + #DEPT2");
System.out.println(expression.getValue(context));

大冰块
非常感谢您的喜欢!
大冰块