Skip to content

Instantly share code, notes, and snippets.

@artem-smotrakov
Created April 14, 2021 07:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artem-smotrakov/0b2619b967c331d1135f791f3d701c87 to your computer and use it in GitHub Desktop.
Save artem-smotrakov/0b2619b967c331d1135f791f3d701c87 to your computer and use it in GitHub Desktop.
Example of evaluating an expression with JUEL
public static Object evaluate(String expression) {
ExpressionFactory factory = new de.odysseus.el.ExpressionFactoryImpl();
ELContext context = new de.odysseus.el.util.SimpleContext();
ValueExpression e = factory.createValueExpression(context, expression, Object.class);
return e.getValue(context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment