Hi Rahul,

thanks for your answer. I downloaded the latest nightly build and it works now. It is a bit unfortune that the website shows the API of a not yet released version and the download section (http://commons.apache.org/jexl/downloads.html) only lists the stable releases with a smaller set of functionality.

Regards,
Seb

Rahul Akolkar wrote:
On 2/9/08, Sebastian <[EMAIL PROTECTED]> wrote:
Hi,
I am trying to use JEXL 1.1 embedded within a J2SE application.

I am trying to create a map in JEXL as described here
http://commons.apache.org/jexl/reference/syntax.html#Literals

My expression looks something like this:

String myExpression="[\"key1\"=>\"value1\",\"key2\"=>\"value2\"]";

However JEXL throws the exception below when I try to create the
expression object using:

ExpressionFactory.createExpression(myExpression);

How does my expression need to look like if evaluating the expression
should return a Map object.

<snip/>

That bit of functionality was added after the 1.1 release (the docs
are for 1.1.1-SNAPSHOT -- unfortunately, I'm not sure if we have
retained the 1.1 docs anywhere on the site) i.e. you'll have to build
the trunk to try out the above.

-Rahul


Thanks in advance,
Seb

The exception:
--------------

org.apache.commons.jexl.parser.ParseException: Encountered "[" at line
1, column 1.
Was expecting one of:
     <INTEGER_LITERAL> ...
     <FLOAT_LITERAL> ...
     "empty" ...
     "(" ...
     "size" ...
     "-" ...
     "~" ...
     "!" ...
     "not" ...
     "null" ...
     "true" ...
     "false" ...
     <IDENTIFIER> ...
     <STRING_LITERAL> ...

        at
org.apache.commons.jexl.parser.Parser.generateParseException(Parser.java:4176)
        at 
org.apache.commons.jexl.parser.Parser.jj_consume_token(Parser.java:4043)
        at org.apache.commons.jexl.parser.Parser.Expression(Parser.java:320)
        at org.apache.commons.jexl.parser.Parser.Assignment(Parser.java:362)
        at
org.apache.commons.jexl.parser.Parser.StatementExpression(Parser.java:1922)
        at org.apache.commons.jexl.parser.Parser.Statement(Parser.java:1841)
        at org.apache.commons.jexl.parser.Parser.JexlScript(Parser.java:73)
        at org.apache.commons.jexl.parser.Parser.parse(Parser.java:32)
        at
org.apache.commons.jexl.ExpressionFactory.createNewExpression(ExpressionFactory.java:123)
        at
org.apache.commons.jexl.ExpressionFactory.createExpression(ExpressionFactory.java:101)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to