This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JSF and the fly likes Phase-listener  not being called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Phase-listener  not being called" Watch "Phase-listener  not being called" New topic

Phase-listener not being called

Haris Karameh
Ranch Hand

Joined: Oct 17, 2002
Posts: 38
I am rather new in JSF development. I am using Rational 6/WAS Express 6.0 and am trying to implement phase-listener.
I added a classs :
package hcode.beans;
public class PhaseTracker implements
javax.faces.event.PhaseListener {

public PhaseTracker(){
System.out.println("NEW PHASETRACKER CREATED");
public void afterPhase(PhaseEvent event) {
System.out.println("AFTER - "+ event.getPhaseId());
public void beforePhase(PhaseEvent event) {
System.out.println("BEFORE - "+ event.getPhaseId());
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;

and changed /WebContent/WEB-INF/faces-config.xml to include
<phase-listener>hcode.beans.PhaseTracker</phase-listener> <!-- my adition -->
<phase-listener></phase-listener> <!-- the original entry -->

However, after publishing the app and restarting sthe server nothing happens. The listener is never loaded/called, I do not see any messages on the console or the log. What am I doing wrong ? The rest of the app works fine.
Pari Gandhi

Joined: Feb 26, 2009
Posts: 10
have you tried debugging?
Haris Karameh
Ranch Hand

Joined: Oct 17, 2002
Posts: 38
Never, mind. I found out : There is a bug in version of WAS I am using ( that ignores all defined listeners exept the last defined.

I made a workaround, I define only my listener, and changed the code to call ibm defined one by itself.
I agree. Here's the link:
subject: Phase-listener not being called
jQuery in Action, 3rd edition