On 4/27/06, 王曾wang_zeng <[EMAIL PROTECTED]> wrote:

Thank you,Craig. What do you mean by setup action? Is that the kind of
action which  grabs  some data, do some encapsilation work, and stuff them
into JSP scopes.


Yes, that's what I meant.

You say we can archive the goal with shale as well as without  shale. I
remeber that between phases a Phase Event will be fired. When JSF skips
directly to the  Render  Response  phase,  can  I  use  phase  event
listener  to  grab  data  ?


Yes.  The way to do this would be to define a phase listener for Render
Response phase, and do your data collection in the beforePhase event
handler.  You also have to remember that your listener is going to receive
beforePhase() calls for *all* simultaneously active requests, not just the
one page you might be interested in.  And, don't forget to deregister
yourself as a listener when the request completes, so you don't create a
memory leak.

Is this approach what you think is painful?


I don't know if I would call it painful, but it is certainly a lot of
complexity to worry about.  It is much simpler to have a framework do the
hard stuff for you.  Indeed, a phase listener is how Shale itself calls the
relevant application event calbacks -- but it shares a single listener
instance across all requests, and only makes the callback calls on the
relevant backing bean -- you don't have to worry about anything except "what
data do I need to set up for *this* request."

--
Wang Zeng


Craig

Reply via email to