commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hubert Rabago" <hrab...@gmail.com>
Subject [jexl] EL-style string evaluations
Date Mon, 19 Jun 2006 16:25:46 GMT
Is the sample in this message valid:
http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=111974074105369&w=2

        SomeObject thingy = new SomeObject();
        thingy.setFoo( "Blah" );

        String expr =
            "JEXL let's you do everything you'd do with EL. ${thingy.foo}";

        Expression e = ExpressionFactory.createExpression( expr );
        JexlContext jc = JexlHelper.createContext( );
        jc.getVars( ).put("thingy", thingy);
        String message = (String) e.evaluate(jc);

I need this functionality in my app.  I tried out the code above but got this:

org.apache.commons.jexl.parser.ParseException: Encountered "let" at
line 1, column 6.
Was expecting one of:
    "||" ...
    ... etc ...
	at org.apache.commons.jexl.parser.Parser.generateParseException(Parser.java:3274)
      ... etc ...

What's the proper way of evaluating "expr" in the sample above using JEXL?

thanks,
Hubert

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message