Integrating JBoss EL with JSF

JBoss EL is a powerful tool if you are using JSF. You can pass parameters to methods in JSF with it. It is my favorite tool right now while developing with JSF. I thought it was coming with Seam only, I mean I thought that you cannot use it without Seam but then in a PrimeFaces-Spring-Hibernate project I needed this. It turns out that you can use JBoss el w/o Seam also and it is very easy to integrate.

1. Just download JBoss EL jar to your web-ing/lib folder, or add it as a dependency in your pom.xml file ( if you’re using maven)

and put this in your web.xml file:

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

that is it. now you can do a lot of tricks like :

<ui:repeat var="day"  value="#{bean.user.getWorkingDays(bean.periodStartDate, bean.periodEndDate)}">
<p:commandButton value="#{day}" action="#{bean.selectDay(day)}"/>
</ui:repeat>

yes, like above all kind of tricks can be done now.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s