You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Simon Lessard <si...@gmail.com> on 2006/11/03 15:40:08 UTC

Setting a custom lifecycle

Hello everyone,

I have a little specification question. How can you set a different
Lifecycle to be used by the default FacesServlet? The specification (section
10.2.6.2) says that you can define a javax.faces.LIFECYCLE_ID context-param
in web.xml.

Then the question become when can you register the lifecycle instance for
the defined new id since FacesServlet is executed on startup and get a cahed
version of the Lifecycle in its init() method?

I guess I could use another servlet to init it given it's started earlier in
the startup sequence, but that not too good looking. The other way I see is
creating a new LifecycleFactory, but then I'll either lose the link to the
default lifecycle or I'll link the application to a specific implementation
by using the Impl class in my custom factory... Both solutions look quite
bad, is there something I'm missing?


Regards,

~ Simon

RE: Setting a custom lifecycle

Posted by David Friedman <hu...@ix.netcom.com>.
This is a JSF 1.2 feature which I believe is not yet implemented in MyFaces.
And I believe it would be configurable per FacesServlet so you could have
different servlets mapped to different extensions, each using a different
lifecycle but all sharing managed beans, resolvers, etc.

Regards,
David
  -----Original Message-----
  From: Simon Lessard [mailto:simon.lessard.3@gmail.com]
  Sent: Friday, November 03, 2006 9:40 AM
  To: MyFaces-Users
  Subject: Setting a custom lifecycle


  Hello everyone,

  I have a little specification question. How can you set a different
Lifecycle to be used by the default FacesServlet? The specification (section
10.2.6.2) says that you can define a javax.faces.LIFECYCLE_ID context-param
in web.xml.

  Then the question become when can you register the lifecycle instance for
the defined new id since FacesServlet is executed on startup and get a cahed
version of the Lifecycle in its init() method?

  I guess I could use another servlet to init it given it's started earlier
in the startup sequence, but that not too good looking. The other way I see
is creating a new LifecycleFactory, but then I'll either lose the link to
the default lifecycle or I'll link the application to a specific
implementation by using the Impl class in my custom factory... Both
solutions look quite bad, is there something I'm missing?


  Regards,

  ~ Simon