views:

426

answers:

3

Hey,

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.

A: 

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

Ravi S
A: 

Hi,

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,

Arthur Ronald F D Garcia
I've put the jar in a shared lib setup on the server. I've tried setting the class loader to parent_first and parent_last :\Thx for the note about the limitations but I'm pretty familiar with EL just never used it specifically this way in WAS :(
rat
A: 

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".

calavera.info