rat
rat

Reputation: 2554

Using JBoss EL with Websphere

I'm doing a project which is going to run on Websphere.

I'm using JSF/Facelets/Richfaces for this project.

I want to use the JBoss EL implementation as it allows calling methods with parameters from EL etc.

... usually this is accomplished by getting the JBoss EL jar and then putting this in the web.xml:

 <context-param>
  <param-name>com.sun.faces.expressionFactory</param-name>
  <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
 </context-param>

However this isn't working ... I don't know if its a problem with Websphere or ...???

I get a stack trace when going to the page saying it can't parse the EL where I have passed a method a parameter:

<a4j:commandLink value="Delete" action="#{mcsaAdmin.deleteLanguage(1234)}" />

Looking at the stacktrace it appears to still be using the standard sun EL:

Caused by: javax.el.ELException: Error Parsing: #{mcsaAdmin.deleteLanguage(1234)}
 at com.sun.el.lang.ExpressionBuilder.createNodeInternal(Unknown Source)
 at com.sun.el.lang.ExpressionBuilder.build(Unknown Source)
 at com.sun.el.lang.ExpressionBuilder.createMethodExpression(Unknown Source)
 at com.sun.el.ExpressionFactoryImpl.createMethodExpression(Unknown Source)
 at com.sun.facelets.tag.TagAttribute.getMethodExpression(TagAttribute.java:141)

Note the 'com.sun.el.ExpressionFactoryImpl' instead of 'org.jboss.el.ExpressionFactoryImpl' as specified above ...

Am I doing something obviously wrong? Anyone have any ideas... I'm using standard JSF implementation from majorra project or whatever provided on sun website and richfaces 3.1.4 and facelets 1.1.14.

Upvotes: 3

Views: 2961

Answers (4)

roel
roel

Reputation: 2003

Have you set the classloader correct? In websphere you have to set the class loader in multiple settings. Set the web-module classloader to Parent last and the application class loader to parent last.

If both are not on parent last, your own jars might not be used, but instead the ones provided with websphere.

Upvotes: 0

calavera.info
calavera.info

Reputation: 1200

Maybe the problem is not with Websphere, but with JSF implementation, because "com.sun.faces.expressionFactory" is JSF implementation specific. I had the same problem when I used MyFaces for which the correct param name is "org.apache.myfaces.EXPRESSION_FACTORY".

Upvotes: 1

Arthur Ronald
Arthur Ronald

Reputation: 33785

You are right. Include jboss-el.jar in classpath /WEB-INF/lib and define in web.xml

<context-param>
    <param-name>com.sun.faces.expressionFactory</param-name>
    <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>

But There are some limitation. See here

If you want to know a good insith about Expression Language, see Extending the Java EE Unified Expression Language with a Custom ELResolver and FAQ about Expression Language

regards,

Upvotes: 0

Ravi S
Ravi S

Reputation: 61

this could be due to a classpath scoping issue. Where have you copied your jboss el jar?

Upvotes: 0

Related Questions