users@glassfish.java.net

Re: In wich order and by who PhaseListeners get called (faces-config.xml files)

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Fri, 20 Jun 2008 12:18:22 -0700

The JSF specification isn't specific on the order that faces-config.xml
from JAR files are processed. That said,
the implementation processes them in the natural sort order based off
the name of the JAR.

So, if you need to have a particular listener installed before the
others, you could rename the jar (say a-seam.jar) to have it first in
the processing list.

JSF 2.0 hopes to address this particular issue.

glassfish_at_javadesktop.org wrote:
> Hi; please could some one tell us by who and how are the differents PhaseListeners constructors called by the Glassfish server while deploying ?
>
> My probleme is that I've seen in a sample project (a ear demonstration Seam uses under Glassfish) that when jsf-extensions-dynamic-faces-0.1.jar is in the project libs the app fails ( an exception ..two SeamPhaseListener installed...)
>
> All this seams because of the handling done with the PhaseListeners instanciations.
> So being able to change the order in which this is done will resolve the (blocking) issue
>
> As for me this has to do with the way the server collects all faces-config.xml presents in the ear
> I got mine
> stating this :
> [i]<lifecycle>
> <phase-listener>
> org.jboss.seam.jsf.SeamPhaseListener
> </phase-listener>
> </lifecycle>[/i]
>
> and in jsf-extensions-dynamic-faces-0.1.jar there is another faces-config.xml
> and so may be in other jars...
>
>
> Seems like Glassfish is instantiating mine once then again when dealing with the faces-config in jsf-extensions-dynamic-faces-0.1.jar
>
> I post here an excerpt from jsf-extensions-dynamic-faces-0.1.jar's faces-config in case ypu can see what is conflicting with
> <lifecycle>
> <phase-listener>
> org.jboss.seam.jsf.SeamPhaseListener
> </phase-listener>
> </lifecycle>
>
>
> Regards.
>
>
> [i]<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
> version="1.2">
>
> <application>
> <state-manager>com.sun.faces.extensions.avatar.application.DeferredStateManager</state-manager>
> </application>
>
> <factory>
> <lifecycle-factory>com.sun.faces.extensions.avatar.lifecycle.ExtensionsLifecycleFactoryImpl</lifecycle-factory>
> </factory>
>
> <component>
> ....
> .....
> ...
> </component>
>
>
> <render-kit>
>
> <renderer>
> <component-family>com.sun.faces.extensions.avatar.Scripts</component-family>
> <renderer-type>com.sun.faces.extensions.avatar.Scripts</renderer-type>
> <renderer-class>com.sun.faces.extensions.avatar.renderkit.ScriptsRenderer</renderer-class>
> </renderer>
>
> <renderer>
> <component-family>com.sun.faces.AjaxZone</component-family>
> <renderer-type>com.sun.faces.AjaxZone</renderer-type>
> <renderer-class>com.sun.faces.extensions.avatar.renderkit.AjaxZoneRenderer</renderer-class>
> </renderer>
>
> </render-kit>
>
> </faces-config>[/i]
> [Message sent by forum member 'hagbc' (hagbc)]
>
> http://forums.java.net/jive/thread.jspa?messageID=281609
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>