There is indeed a partial ordering specified in Section 10.3.2
(META-INF/faces-config.xml from jar files, then look at the
javax.faces.CONFIG_FILES context init parameter, then
WEB-INF/faces-config.xml if it exists) ... but that doesn't guarantee
you the ordering of listener calls.  Even if it tried, you are still
not out of the woods -- for example, the order that JAR files will be
processed depends on the implementation of the app server's class
loader.

In general, think of phase events and listeners as a way to do things
for the *application* (i.e. the code that actually runs during a
phase) -- they should not have ordering dependencies between each
other.  This is a general principle for events and listeners
throughout the Java model (for example, PropertyChangeEvents from a
JavaBean), where the order of event notifications is not
deterministic.

Craig


On 7/14/05, Martin Marinschek <[EMAIL PROTECTED]> wrote:
> This is - by the way- the sequence of reading config files in MyFaces:
> 
>             feedStandardConfig();
>             feedMetaInfServicesFactories();
>             feedJarFileConfigurations();
>             feedContextSpecifiedConfig();
>             feedWebAppConfig();
> 
> regards,
> 
> Martin
> 
> On 7/14/05, Martin Marinschek <[EMAIL PROTECTED]> wrote:
> > Yes,
> >
> > you are right... It would be even nicer to be able to exactly define
> > the sequence.
> >
> > Still, I don't think that using a separate servlet here is the way to
> > go - I mean why has the concept of a phase listener been developed? We
> > should rather fix the problems we have with this thing instead.
> >
> > regards,
> >
> > Martin
> >
> > On 7/14/05, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > > On 7/14/05, Martin Marinschek <[EMAIL PROTECTED]> wrote:
> > > > I think they do execute in a particular order, i.e. the order the
> > > > faces-config files are loaded.
> > >
> > > They are called in a particular order for a particular implemention, for 
> > > sure.
> > > Is it specified in the spec, though? (Pure ignorance -- maybe it is).
> > > Is the order the faces-config files are loaded from jar files known?
> > >
> > > > With that the dataTable phaselistener would of course be situated
> > > > ahead of your phaseListener.
> > > >
> > > > No if the AJAX phase listener makes it into the framework, it will be
> > > > the first one to be called - which should be quite reasonable.
> > >
> > > If it's the first one called, does this mean it'd potentially access
> > > application data outside of a phase? (before the application's before
> > > phase listener is executed, and likewise for after)
> > >
> > > It's too bad the JSF spec doesn't provide some way to insure that
> > > application-level phase listeners are triggered, then "framework"
> > > component phase listeners.   I do understand the difficulties between
> > > distinguishing between them, though.
> > >
> > > Maybe just insuring that any faces-config listeners in
> > > WEB-INF/faces-config.xml (or otherwise specified in web.xml) were
> > > executed before faces-config.xml files in jars would be helpful.
> > > Probably useless conjecturing, though.
> > >
> >
>

Reply via email to