I am using JEXL http://commons.apache.org/proper/commons-jexl/ to evaluate Strings.
I tried the following code
String jexlExp = "'some text ' + output?'true':'false'";
JexlEngine jexl = new JexlEngine();
Expression e = jexl.createExpression(jexlExp);
JexlContext jc = new MapContext();
jc.set("output", false);
Object x = e.evaluate(jc);
System.out.println(x);
It is evaluating the expression to a wrong result. When I try to concat two Strings it works well. It is not working when I try to concat a string and expression.
So, how do I concatenate a string and expression in JEXL?