• 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

PhaseListener problem

Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have developed an application in JSF where the JSF page's Backing bean extends an AbstractBB class. AbstractBB is an abstract class that implements PhaseListener.

The beforePhase() and afterPhase() methods call the callback methods beforeRenderResponse() and afterRenderResponse() respectively.

Also I have a listener class that implements ServletRequestAttributeListener.
This class implements attributeAdded() method that calls an fireInit() method. This class is registered as the listener in the web.xml.

The fireInit() method registers the AbstractBB instance on the default lifecycle instance as the phase listener(the backing bean extending the AbstractBB gets registered as phase listener), and calls the init() method on the AbstractBB class.

The init() method is implemented in the backing bean. It gets called after the constructor of the backing bean gets called and before the apply request values phase.

But if I try to access the components inside the backing bean, it seems to be not possible. Although I don't get any error I am not able to get the component instance. If I create a new instance of the component even then I am not able to set values on the component( though if I try to set the value of a component like this inside the constructor then it is possible).

What should be done to solve this problem?? I need to set values inside the init() method on the component..
    Bookmark Topic Watch Topic
  • New Topic