Add the phase listener to your faces-config.xml file instead so that
it is only registered once at application startup.

On 3/26/06, Lisaa <[EMAIL PROTECTED]> wrote:
>
> Hi.,
>   In order to manipulate (update model before event request) the default
> lifecycle, I added a PhaseListener to my Backing bean's constructor.
>
> CODE:
>
> lifecycle.addPhaseListener(new PhaseListener() {
>                        public void beforePhase(PhaseEvent event) {
>                             resetValues();
>                         }
>
>                         public void afterPhase(PhaseEvent event) {
>
>                         }
>
>                         public PhaseId getPhaseId() {
>                             return PhaseId.RENDER_RESPONSE;
>                         }
>                     });
>
>  It works fine and the method calls as how it should be.
>     But the problem is when I open a new browser and open my index page then
> the method   resetValues() (from old PhaseListener) was called even before
> it starts its session. So whenever I open a new browser then the
> PhaseListener array gets incremented and accordingly it calls that many
> times this   resetValues() method. I totally went mad on this.
>
> Or I'm doing any wrong in placing/adding PhaseListener ?
> Please help me with your suggestions.
>
> Thanks
> --
> View this message in context: 
> http://www.nabble.com/Problem-with-PhaseListener-t1344308.html#a3595725
> Sent from the MyFaces - Users forum at Nabble.com.
>
>

Reply via email to