• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom tags : when does JSF call 'decode' ?

 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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 ?

Thanks.
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

http://www.jsftutorials.net/faces-config/phaseTracker.html

--
Sergey : https://ajax4jsf.dev.java.net/
 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is very reasonable.
 
g madhava
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF as such is a component framework and has a processing life cycle.
I think this might help you http://java.sun.com/javaee/javaserverfaces/reference/docs/customRenderKit.html

See the section "Performing Decoding"
 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic