myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Green <myfa...@jeremygreen.me.uk>
Subject Re: PhaseListener Doubts
Date Wed, 14 Dec 2005 18:12:07 GMT
What happens if you...

Get rid of your code for registering PhaseListeners and, instead, use:

<lifecycle>
<phase-listener>co.com.atenaerp.seguridad.acegi.jsf.AccessDecicionManagerPhaseListener</phase-listener>
</lifecycle>

in faces-config.xml. (PhaseListeners are not bound to managed/backing 
beans, but are bound to the whole JSF application. i.e. any particular 
PhaseListener that you register via faces-config.xml will be activated for 
every request made to the application's FacesServlet.)

Make sure that you're not parsing faces-config.xml twice for the reasons 
that Bruno Aranda gave in his e-mail.

Then, make sure that your implementation of PhaseListener has a method 
exactly like this:

  public PhaseID getPhaseID() {
    return PhaseID.RENDER_RESPONSE;
  }

This tells MyFaces to only invoke the beforePhase(PhaseEvent) and 
afterPhase(PhaseEvent) methods in your PhaseListener for the 
RENDER_RESPONSE phase.

The code you want to execute after the RENDER_RESPONSE phase would then go 
in your PhaseListener's afterPhase(PhaseEvent) method.

Jeremy



Mime
View raw message