This usually is a problem with your web.xml/faces-config.xml file:

If your config-file is actually called "faces-config.xml" and you
additionally add this "faces-config.xml" file in your web.xml context
parameter for faces-config files, you will have this file parsed (and
therefore your listener added) twice.

You should see this happening at startup.

In short: call your config file "faces-config.xml" - don't configure
it in your web.xml..

regards,

Martin

On 12/7/05, Yee CN <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi,
>
>
>
> I have implemented a very simple phaseListener as follows. It seems to be
> working, but the output is very puzzling. It seems to indicate all phases
> are being executed twice, or that the phase listener is being invoked twice
> on each phase. Can someone explain this?
>
>
>
> Many thanks.
>
>
>
> Regards,
>
> Yee
>
>
>
> ----------------------------------------------------
>
>
>
> public class PhaseTracker implements PhaseListener {
>
>
>
>       private static final Logger logger = Logger.getLogger("com.test.web");
>
>
>
>       public PhaseId getPhaseId() {
>
> PhaseId.ANY_PHASE;
>
>       }
>
>
>
>       public void beforePhase(PhaseEvent e) {
>
>             logger.info("BEFORE " + e.getPhaseId());
>
>       }
>
>
>
>       public void afterPhase(PhaseEvent e) {
>
>             logger.info("AFTER " + e.getPhaseId());
>
>       }
>
> }
>
>
>
>
>
> 18:22:04,893 DEBUG FacesServlet:99 - service begin
>
> 7/12/2005 18:22:08 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE RESTORE_VIEW(1)
>
> 7/12/2005 18:22:25 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE RESTORE_VIEW(1)
>
> 7/12/2005 18:23:30 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER RESTORE_VIEW(1)
>
> 7/12/2005 18:24:06 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER RESTORE_VIEW(1)
>
> 7/12/2005 18:24:24 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE APPLY_REQUEST_VALUES(2)
>
> 7/12/2005 18:26:23 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE APPLY_REQUEST_VALUES(2)
>
> 7/12/2005 18:26:26 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER APPLY_REQUEST_VALUES(2)
>
> 7/12/2005 18:26:52 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER APPLY_REQUEST_VALUES(2)
>
> 7/12/2005 18:26:52 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE PROCESS_VALIDATIONS(3)
>
> 7/12/2005 18:26:52 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE PROCESS_VALIDATIONS(3)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER PROCESS_VALIDATIONS(3)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER PROCESS_VALIDATIONS(3)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE UPDATE_MODEL_VALUES(4)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE UPDATE_MODEL_VALUES(4)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER UPDATE_MODEL_VALUES(4)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase
>
> INFO: AFTER UPDATE_MODEL_VALUES(4)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE INVOKE_APPLICATION(5)
>
> 7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase
>
> INFO: BEFORE INVOKE_APPLICATION(5)
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to