I see that this functionality has already made it into JSF 1.2, using
annotations.   The interesting part of the implementation is that it
also supports a destroy method using ServletRequestListener,
HttpSessionListener, and ServletContextListener.

http://weblogs.java.net/blog/edburns/archive/2005/08/using_ejb_annot.html

https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=119


On 10/26/05, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> I've been reviewing open issues with my current application, and some
> of them seem to deal with using Spring.  This is kind of frustrating
> because I'm finding that JSF managed beans do ALMOST everything I want
> without Spring, except for providing a
> InitializingBean.afterPropertiesSet() method call after a new bean's
> properties have been set.
>
> So after pondering it for a bit, it occurred to me that there's no
> reason why support for this interface (repackaged for MyFaces) can't
> be added to the org.apache.myfaces.el.VariableResolverImpl or to the
> org.apache.myfaces.config.ManagedBeanBuilder class.
>
> It seems to me that modifying one of the above classes to call the
> below code would provide this functionality in a backward-compatible
> way that does not affect the TCK.
>
> if (newBean instanceof InitializingBean)
> ((InitializingBean)newBean).afterPropertiesSet();
>
> This could be done either as the last line in
> ManagedBeanBuilder.buildManagedBean() or right after the call to
> buildManagedBean() in VariableResolverImpl.resolveVariable.
>
> Unfortunately, I can't see a way to adding this functionality cleanly
> as a generic JSF tomahawk extension, so it would have to remain a
> MyFaces-only feature.
>
> Thoughts?
>

Reply via email to