You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Stan Carney <st...@moohoffa.com> on 2008/08/27 20:14:32 UTC

MYFACES-1761 (Handling PostConstruct annotations - wrong order)?

Hello all,

I finally in the process of upgrading to MyFaces 1.2 and have made the 
decision to drop our use of the Shale preprocess() and prerender() 
methods, as well as Shale entirely, and try the @PostConstruct and 
@PreDestroy annotations. Soon after I find I'm a victim of bug 1761 
(https://issues.apache.org/jira/browse/MYFACES-1761) and that any 
solution appears slow to making it into a released version. I was going 
to go ahead and build a custom version of MyFaces 1.2.3 with the 
proposed patch supplied in the ticket but before I do has it been done 
before? i.e. downloadable from the net with source? Or am I missing 
something?

Thanks,
Stan

Re: MYFACES-1761 (Handling PostConstruct annotations - wrong order)?

Posted by Stan <st...@moohoffa.com>.
So for those interested the ticket is still pending as of 1.2.4 although 
I have only tested it to 1.2.3. Spring 2.5 introduced the same 
functionality so I was able to unmap my annotated managed beans from 
faces-config.xml, leaving the @Resource and @PostConstruct annotations, 
and set them up in Spring according to their guide: 
http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-annotation-config.

I've actually preferred to map my managed beans in Spring for some time 
now so I don't have to worry about maintaining two large xml files. As 
of the latest version of Spring and their new annotations there isn't 
much for mapping required anymore. Request parameters are pulled via a 
utility class:

    protected Object getRequestParameter(String parameter) {
        FacesContext context = FacesContext.getCurrentInstance();
        return 
context.getExternalContext().getRequestParameterMap().get(parameter);
    }

Thanks,
Stan


Stan Carney wrote:
> Hello all,
>
> I finally in the process of upgrading to MyFaces 1.2 and have made the 
> decision to drop our use of the Shale preprocess() and prerender() 
> methods, as well as Shale entirely, and try the @PostConstruct and 
> @PreDestroy annotations. Soon after I find I'm a victim of bug 1761 
> (https://issues.apache.org/jira/browse/MYFACES-1761) and that any 
> solution appears slow to making it into a released version. I was 
> going to go ahead and build a custom version of MyFaces 1.2.3 with the 
> proposed patch supplied in the ticket but before I do has it been done 
> before? i.e. downloadable from the net with source? Or am I missing 
> something?
>
> Thanks,
> Stan


Re: MYFACES-1761 (Handling PostConstruct annotations - wrong order)?

Posted by Bjørn T Johansen <bt...@havleik.no>.
We are now at version 1.2.5, when is this going to be resolved??
I was a bit disappointed when I found a neat solution to my bean initialize problem, only to find out that there is
a big bug in Myfaces 1.2.x that has been there since 6. Nov 2007 that make postConstruct useless when using Myfaces...


BTJ

On Wed, 27 Aug 2008 12:14:32 -0600
Stan Carney <st...@moohoffa.com> wrote:

> Hello all,
> 
> I finally in the process of upgrading to MyFaces 1.2 and have made the 
> decision to drop our use of the Shale preprocess() and prerender() 
> methods, as well as Shale entirely, and try the @PostConstruct and 
> @PreDestroy annotations. Soon after I find I'm a victim of bug 1761 
> (https://issues.apache.org/jira/browse/MYFACES-1761) and that any 
> solution appears slow to making it into a released version. I was going 
> to go ahead and build a custom version of MyFaces 1.2.3 with the 
> proposed patch supplied in the ticket but before I do has it been done 
> before? i.e. downloadable from the net with source? Or am I missing 
> something?
> 
> Thanks,
> Stan