• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Phase-listener not being called

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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(){
super();
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
<lifecycle>
<phase-listener>hcode.beans.PhaseTracker</phase-listener> <!-- my adition -->
<phase-listener>com.ibm.faces.webapp.ValueResourcePhaseListener</phase-listener> <!-- the original entry -->
</lifecycle>

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.
TIA ,
hk
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you tried debugging?
 
Haris Karameh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never, mind. I found out : There is a bug in version of WAS I am using (6.0.2.5) 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic