Try to return a PhaseID constant value into getPhaseId() of your Listener.
Do that for each Phase, and check if you have twice call into afterPhase.
A simple logger into beforePhase and afterPhase can do the job.



2005/9/10, Saul Qunming Yuan <[EMAIL PROTECTED]>:
> Yes, I rebuilt my application and cleaned out the work-directory. When I
> start tomcat, I see phase listener registered only once:
> 
> DEBUG com.sun.faces.lifecycle.LifecycleImpl -
> addPhaseListener(RENDER_RESPONSE(6),[EMAIL PROTECTED]
> 
> thanks,
> 
> Saul
> 
> ----- Original Message -----
> From: "Martin Marinschek" <[EMAIL PROTECTED]>
> To: "MyFaces Discussion" <users@myfaces.apache.org>
> Sent: Friday, September 09, 2005 5:13 AM
> Subject: Re: Why afterPhase(PhaseEvent event) gets called twice
> 
> 
> > Sure you cleaned out your application, work-directory, etc.?
> >
> > this clearly is the problem if the PhaseListener is called twice!
> >
> > regards,
> >
> > Martin
> >
> > On 9/9/05, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote:
> >> Thanks for your response. Yes, I have javax.faces.CONFIG_FILES and
> >> faces-config.xml defined in web.xml, I removed that part from web.xml,
> >> but
> >> still get the same problem. Any ideas?
> >>
> >> thanks.
> >>
> >> ----- Original Message -----
> >> From: "Jan Bols" <[EMAIL PROTECTED]>
> >> To: "MyFaces Discussion" <users@myfaces.apache.org>
> >> Sent: Thursday, September 08, 2005 2:32 AM
> >> Subject: Re: Why afterPhase(PhaseEvent event) gets called twice
> >>
> >>
> >> > Perhaps, this comes from the fact that you specify
> >> >
> >> >     <context-param>
> >> >         <param-name>javax.faces.CONFIG_FILES</param-name>
> >> >         <param-value>/WEB-INF/faces-config.xml</param-value>
> >> >     </context-param>
> >> >
> >> > in your web.xml file. The javax.faces.CONFIG_FILES variable is set to
> >> > /WEB-INF/faces-config.xml by default and specifying it again in web.xml
> >> > makes the faces-config.xml file to be processed twice (for some raeson
> >> > I
> >> > don't know). This results in your registered phaseListener to actually
> >> > be
> >> > registered twice as well.
> >> >
> >> > The solution is to delete this part in your web.xml or to rename
> >> > faces_config.xml to something else.
> >> >
> >> > Jan
> >> >
> >> > On Thu, 08 Sep 2005 03:25:38 +0200, Saul Qunming Yuan
> >> > <[EMAIL PROTECTED]>
> >> > wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I implemented a phaseListener to catch phase event. However, every
> >> >> time
> >> >> a jsp page rendered from a backing bean, the afterPhase(PhaseEvent
> >> >> event) method gets called twice, and I get the same viewId by calling
> >> >> facesContext.getViewRoot().getViewId(). Any ideas what the problem is?
> >> >>
> >> >> thanks,
> >> >> Saul
> >> >>
> >> >>
> >>
> >>
> >
> >
> > --
> >
> > http://www.irian.at
> > Your JSF powerhouse -
> > JSF Trainings in English and German
> 
> 


-- 

hicham ABASSI
[EMAIL PROTECTED]

Reply via email to