This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSF and the fly likes Custom tags : when  does JSF call 'decode' ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Custom tags : when  does JSF call Watch "Custom tags : when  does JSF call New topic

Custom tags : when does JSF call 'decode' ?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311

I'm new to JSF.
I'm following a tutorial for implementing my own (custom) JSF tags.
It works, but I don't really understanding what happens behind the scenes :

My tutorial creates a customized *input* compoenet.
It inherit from UIInput (javax.faces.component.UIInput), and implements encoding/decoding methods.

My problem is just the *decoding* method:
when would the JSF framework call it ?
I mean, the controller servlets gets various HTTP requests from browsers. How does it decide which UI components should get a chance to 'decode()' this HTTP request ?
Is it based on some hidden parameter in the request ?

Sergey Smirnov
Ranch Hand

Joined: May 29, 2003
Posts: 167
Register the phase listener in your application and you can see what happens and when. This is an URL to a ready-to-use phaseTracker:

Sergey :
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Thanks, I actually did this...
My problem is not seeing *when* things are called, but rather understanding *why* the JSF spec decides to call them...

I other words, I'm looking for information from the following perspective:
An HTTP request arrives to the controller servlet. What would the servlet do - how would it decide which UIComponents need their 'decode()' method to be called now ?
Would it rely on request parameters ? session data ? etc...
sandy li

Joined: May 08, 2006
Posts: 3
That is very reasonable.

<a href="" target="_blank" rel="nofollow">Sugoo</a>
g madhava
Ranch Hand

Joined: Sep 14, 2001
Posts: 85
JSF as such is a component framework and has a processing life cycle.
I think this might help you

See the section "Performing Decoding"
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Thanks very much
I agree. Here's the link:
subject: Custom tags : when does JSF call 'decode' ?
It's not a secret anymore!