High performance expression language

UI Components for JSF
Locked
averri
Posts: 136
Joined: 07 Sep 2009, 15:51
Location: Brazil

27 Jan 2011, 21:57

I discovered Juel, another Expression Language implementation. One of the key features of Juel is the fast performance.

I'm posting this because I think it is a general interest, everybody wants to boost your JSF application.

I'm trying switch from glassfish EL implementation to Juel EL, because there are benchmarks showing that a JSF table with 1350 lines took 6.5 seconds to render with Glassfish EL, and the same JSF table took 450 ms to render using Juel EL. It's a BIG improvement.

So, if you are interested in boost your Primefaces application, especially the render time, I would like to invite you to test the Juel implementation.

Pesonally, I'm having troubles to integrate Juel with Mojarra 2.0.3. It works fine with MyFaces. If you want to try it and have good results, please share your knowledge.

http://juel.sourceforge.net/guide/start.html
Last edited by averri on 29 Jan 2011, 02:31, edited 1 time in total.

cj91
Posts: 96
Joined: 04 Feb 2010, 00:07

27 Jan 2011, 22:27

Have you tried Mojarra 2.0.4?

cj91
Posts: 96
Joined: 04 Feb 2010, 00:07

27 Jan 2011, 22:38

Also, just curious, what server environment, jdk, and OS are you running? Glassfish, Tomcat, Websphere, JBoss, etc... Sun/IBM/JRockit... windows, linux, aix...

cj91
Posts: 96
Joined: 04 Feb 2010, 00:07

27 Jan 2011, 23:20

Wow! This is fast... It works!

One note is that this isn't supported in JUEL:

Code: Select all

actionListener="#{configMB.swapAction}

Code: Select all

action="#{configMB.swapAction}
You'll have to use "method invocation":

Code: Select all

actionListener="#{configMB.swapAction()}

Code: Select all

action="#{configMB.swapAction()}
This is my stack:
Glassfish 3.0.1
Mojarra 2.0.4
Sun JDK (latest)
Primefaces 2.2.RC2
Windows XP 32bit

Here is my web.xml:

Code: Select all

	<context-param>
		<param-name>com.sun.faces.expressionFactory</param-name>
		<param-value>de.odysseus.el.ExpressionFactoryImpl</param-value>
	</context-param>
el.properties in /src/main/resources:

Code: Select all

javax.el.ExpressionFactory=de.odysseus.el.ExpressionFactoryImpl
javax.el.methodInvocations=true
javax.el.nullProperties=true
javax.el.varArgs=true

robert.m
Posts: 226
Joined: 07 Dec 2010, 22:52
Location: Salzburg/Austria

27 Jan 2011, 23:35

Is this compatible and/or configurable using Spring? Or are there any known issues when using it with Spring (3)?

averri
Posts: 136
Joined: 07 Sep 2009, 15:51
Location: Brazil

28 Jan 2011, 00:12

Is this compatible and/or configurable using Spring? Or are there any known issues when using it with Spring (3)?
R: I'm using Spring 3 without problems. At the moment, it's not configurable using Spring, because does not know about Juel.

My environment is:

Sun JDK 6.0.23
Jetty 6.0.21
Mojarra 2.0.3
Juel 2.2.2
Primefaces 2.2-SNAPSHOT
Windows-7 64

I'm gonna test Mojarra 2.0.4 and post results.

averri
Posts: 136
Joined: 07 Sep 2009, 15:51
Location: Brazil

28 Jan 2011, 00:35

I'm having problems with the following:

Suppose the following code in a XHTML page,

Code: Select all

<f:metadata>
        <f:event type="preRenderView" listener="#{messages.preRender}" />
</f:metadata>
and the corresponding Managed Bean:

Code: Select all

@SessionScoped
public class Messages {

    public void preRender(ComponentSystemEvent cse) {
      // Some usefull stuff
    }

}
The preRender methos is not found.

Code: Select all

Caused by: javax.el.MethodNotFoundException: /user/messages.xhtml @13,81 listener="#{messages.preRender}": Cannot find method 'preRender' in 'class org.aquarefx.dating.web.jsf.Messages'
        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:106)
        at com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:127)
        at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2378)
        at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)
        at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2040)
        at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:1988)
        at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:284)
        at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:242)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:104)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)

cj91
Posts: 96
Joined: 04 Feb 2010, 00:07

28 Jan 2011, 07:04

I'm using the spring entity resolver and am injecting spring beans into annotated managed beans no problem. Running latest spring/spring security (3.0.5).

cj91
Posts: 96
Joined: 04 Feb 2010, 00:07

08 Feb 2011, 00:40

Just wanted everyone to know I've successfully using JUEL 2.2.3 on websphere 7.

Create a shared library with the following jars:
juel-api-2.2.3.jar
juel-impl-2.2.3.jar
juel-spi-2.2.3.jar

Set the shared library to load using an "isolated classloader". Create a "Parent first" classloader and it it to your JVM. Add the shared library to the classloader.

Now, follow all the instructions I posted earlier and you're good to go! JUEL makes a very noticeable performance improvement.

averri
Posts: 136
Joined: 07 Sep 2009, 15:51
Location: Brazil

18 Feb 2011, 14:37

Juel is very fast, but unfortunately, it has some issues with Mojarra 2.0.3 yet.

If you don't use ComponentSystem events, Juel will work fine.

Locked

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests