Hi,

is it possible, to annotate a phase listener as seam bean and to inject another 
bean?

my code looks like this:

##############
the phase listener:

@Name("keeper")
@Scope(ScopeType.SESSION)
@Intercept(InterceptionType.ALWAYS)
public class KeeperPhaseListener implements PhaseListener {

        public KeeperPhaseListener() { }
        
        @In(value="navBean", create=true, required=true)
        private NavigationBean navBean;

        public void beforePhase(PhaseEvent e) {    }
    
    public void afterPhase(PhaseEvent e) {
        keep(e, e.getFacesContext().getViewRoot().getViewId());
    }

    protected void keep(PhaseEvent e, String viewId) {
        navBean.setCurrentPage(viewId);
    }

    public PhaseId getPhaseId() {
        return PhaseId.RENDER_RESPONSE;
    }
}

###################
and the annotation of the bean to inject:

@Name("navBean")
@Scope(ScopeType.SESSION)
public class NavigationBean implements Serializable {

...


in all other beans, the injection works fine.
Both beans are deployed as seam components, but the BijectionInterceptor 
doesn't work for the KeeperPhaseListener. navBean is null and the required 
annotation is ignored.

Thanks for help!

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986206#3986206

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986206
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to