FYI, I'm going to try to go the other way:

Create my own lifecycleFactory implementation, specify it in a faces-config.xml 
file, then have that one's constructor
add a lifecycle called "DAVID", which will be specified in the web.xml as 
mentioned below.  I'll keep everyone posted, I
just need a mental break right now.

Regards,
David

-----Original Message-----
From: David G. Friedman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 14, 2005 4:12 PM
To: MyFaces Discussion
Subject: RE: lifecycle questions


> I doubt you'll find any examples. Changing the
> lifecycle is really a pretty unusual thing to do.

I'm a lot closer but my problem right now is a listener order one: the Myfaces 
listener loads from the Jar BEFORE my
listener can load (to add my new lifecycle).

Essentially, the spec says I can change the default lifecycle (a default 
implementation stores under the
lifecycleFactory key "DEFAULT") using the web.xml context param:

<context-param>
    <param-name>javax.faces.LIFECYCLE_ID</param-name>
    <param-value>DEFAULT</param-value>
</context-param>

So, I want to change "DEFAULT" to "DAVID" so I can use my own lifecycle.  But I 
do that in my listener, which won't load
until AFTER the MyFaces jar's one loads so "DAVID" doesn't get in there and 
MyFaces initialization blows up like so:

INFO: Reading config /WEB-INF/faces-config.xml
Dec 14, 2005 3:29:24 PM org.apache.myfaces.webapp.StartupServletContextListener 
initFaces
SEVERE: Error initializing ServletContext
java.lang.IllegalArgumentException: Unknown lifecycle 'DAVID'.
at 
org.apache.myfaces.lifecycle.LifecycleFactoryImpl.getLifecycle(LifecycleFactoryImpl.java:60)

I would prefer this over also having to change the lifecycleFactory in 
faces-config.xml to use a key other than
javax.faces.LIFECYCLE_ID so things can still follow the JSF v1.1 spec.  Now, 
JSF spec v1.2 would allow me to specify the
javax.faces.LIFECYCLE_ID in an init param for the servlet (i.e. AFTER my 
listener loaded) but MyFaces isn't that far
along yet so it is not an option.

And yes, I tried pushing my lifecycle into the factory to replace "DEFAULT" but 
that exceptions out/fails:
> INFO: java.lang.IllegalArgumentException: Lifecycle with id 'DEFAULT' already 
> exists.

Does anyone have any ideas on how to change the listener load order?

Thanks again for any suggestions,
David

Reply via email to