Thursday, November 20, 2008

Enhanced EL implementation

Normally in JSF you can use EL to access ${bean.someproperty} if this property has a setter and a getter, but sometimes this falls short of what we need. Jboss EL implementation allows to go beyond this point and you can call methods on an object like this ${bean.someobject.somemethod()}, probably this won't change your life but I'm sure it can make your coding easier.

All you need to do is to download jboss-el-2.0.1-GA.jar and declare the dependency:

<dependency>
<groupId>org.jboss.el</groupId>
<artifactId>jboss-el</artifactId>
<version>2.0.1</version>
<scope>compile</scope>
</dependency>

And finally modify the web.xml:
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
Enjoy ;)
blog comments powered by Disqus