Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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
JavaRanch » Java Forums » Java » JSF
Bookmark "Please help to create Phase Listener " Watch "Please help to create Phase Listener " New topic

Please help to create Phase Listener

Kate Something

Joined: Jul 19, 2009
Posts: 1
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

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

Welcome to CodeRanch!

What is a phase listener?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
David O'Meara

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

Joined: Jan 10, 2002
Posts: 63866

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] [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.
I agree. Here's the link:
subject: Please help to create Phase Listener
It's not a secret anymore!