On Mon, Aug 31, 2009 at 8:28 PM, erh<ehas...@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. > eric > -- > View this message in context: > http://www.nabble.com/Using-JSP-EL-expression-language-in-camel-tp25228176p25228176.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