Simon,

    I did what you said.  You are absolutely right...I do have 2
listeners...
     1. org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener
     2. org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener

I do not see where these listeners are configured.
Do you know how I set it up so I just have one listener?

Thanks.


Simon Kitching-3 wrote:
> 
> A.McCall wrote:
>>   I am having the same problem.  My phaselistener is being called twice, 
>> I
>> do not have configs entry in my web.xml, so it's not that.
>>
>> Just wondering....  Did you ever find out why yours was being called
>> twice.
> 
> Phase listeners work fine for me. I'd be willing to bet that you do have 
> the phase listener registered twice.
> 
> I suggest that in your phase listener you get the list of registered 
> listeners then iterate through this and check that there is only one 
> object whose class is your custom listener class.
> 
> LifecycleFactory factory = (LifecycleFactory)
>     FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
> 
> Lifecycle lc =  factory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
> 
> PhaseListener[] listeners = lc.getPhaseListeners();
> 
> If it is registered twice, then you could put a logging statement in 
> your phase-listener's constructor that prints out the current stack 
> trace; that will show you where the instances are being created.
> 
> Regards,
> 
> Simon
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Why-afterPhase%28PhaseEvent-event%29-gets-called-twice-tf288329.html#a7553191
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to