This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes Please help to create Phase Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Please help to create Phase Listener " Watch "Please help to create Phase Listener " New topic
Author

Please help to create Phase Listener

Kate Something
Greenhorn

Joined: Jul 19, 2009
Posts: 1
Hi
please hepl me I need to create a web application with Phase Listener that will check valid requests that are received and forward to other web site for processing and forward results to original requester.

What should I use Request Dispatcher? Some initial code will be appriciated


thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
134

Kate,
Welcome to CodeRanch!

What is a phase listener?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I was goig to say the same thing. It is not a term I have encountered.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

Apparently it's a JSF thingie.

Please be sure to ask JSF questions in the JSF forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
Hi Kate,

To create a PhaseListener

1) Implement javax.faces.event.PhaseListener
2) add functionality to the methods beforePhase(PhaseEvent phaseEvent) and afterPhase(PhaseEvent phaseEvent).

Without other details, I am assuming you wouldnt need to add any code to beforePhase(). An empty method should be enough.

In afterPhase(), get the FacesContext object from PhaseEvent. Further get the viewId from the context and do your bit of magic on it.

Hope this gets you started.
 
 
subject: Please help to create Phase Listener
 
Similar Threads
Page Load - is this doable?
Intercepting Filters in Component diagram
multiple phaselisteners
How can i write in the response through viewhandler? Or even another solution...
Phase-listener not being called