camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Using JSP EL expression language in camel
Date Mon, 31 Aug 2009 19:25:54 GMT
Hi

I have fixed the sample page and removed the replaceAll.




On Mon, Aug 31, 2009 at 9:18 PM, erh<EHASZLA@transunion.com> wrote:
>
>
> Claus Ibsen-2 wrote:
>>
>> On Mon, Aug 31, 2009 at 8:28 PM, erh<EHASZLA@transunion.com> wrote:
>>>
>>> I'm trying to use the JSP EL according to the example listed on
>>> http://camel.apache.org/el.html
>>> It claims that you can call arbitrary functions with camel's version of
>>> the
>>> EL, with the example shown being:
>>>   <el>${in.body.replaceAll('id','orderId')}</el>
>>>
>>> However, when I try to use something like that, I get an exception like
>>> this:
>>> Caused by: javax.el.MethodNotFoundException: Cannot resolve method
>>> 'replaceAll' in 'class java.lang.String'
>>>        at
>>> de.odysseus.el.tree.impl.ast.AstMethod.resolveMethod(AstMethod.java:67)
>>>        at de.odysseus.el.tree.impl.ast.AstMethod.eval(AstMethod.java:97)
>>>        at de.odysseus.el.tree.impl.ast.AstBinary.eval(AstBinary.java:97)
>>>        at de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:42)
>>>        at de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:28)
>>>        at
>>> de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:121)
>>>        at
>>> org.apache.camel.language.juel.JuelExpression.evaluate(JuelExpression.java:63)
>>>       etc...
>>>
>>> I didn't think that the JSP EL allowed for calling functions in this way.
>>> It talks about defining EL functions using static java methods and
>>> calling
>>> them like this:
>>>    ${fn:replaceAll(in.body, 'id', 'orderId')}
>>> but that complains about not being able to resovle fn:replaceAll.
>>> So, how is this supposed to work in Camel?
>>>
>>> I'm using camel 1.6.2-SNAPSHOT as of August 14th and juel 2.1.2.
>>>
>>
>> Hmm are you sure about EL being limited to not invoke methods on objects?
>> It could be as its JSP + JSF based EL and thus targeted for the web
>> world which could have all sorts of limitations.
>>
>> You can use a more powerful language such as: Groovy, MVEL, OGNL etc.
>> instead.
>>
>>
>
> I know the standard JSP language doesn't allow for it.  I don't know about
> JSF EL.  I'd prefer not to have to learn yet another language (nor try to
> explain it to the other developers).
> Clearly, someone came up with the example on that page in the first place,
> so I'm hoping whoever wrote that might chime in with an explanation of how
> he got it to work.
>
> eric
> --
> View this message in context: http://www.nabble.com/Using-JSP-EL-expression-language-in-camel-tp25228176p25228941.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message