Wednesday, September 23, 2009

Choosing an Expression Language

On previous posts I talked about that I liked Jboss-EL. Here is an example of what you can do with jboss-el and not with the standard el:
1:  #{cityService.listCities(selectedCountry)}
This EL is usefull on scenerios where the user selects a country from a combo (selectedCountry) which fires a ajax call and witch returns the cities of the country listing them in a sub combo.
Since I relay wanted use this on my myfaces + spring project I searched googled and found this. Here is how you use Jboss-EL with MyFaces.
  1. We need the myfaces 1.2.7
  2. Add jboss-el to classpath
  3. Add to web.xml :
1:    <context-param>
2: <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
3: <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
4: </context-param>
If you are using RI :
1:  <context-param>
2: <param-name>com.sun.faces.expressionFactory</param-name>
3: <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
4: </context-param>
Should do the trick.

No comments:

Post a Comment