struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig McClanahan" <>
Subject Re: Where dose JSP works in JSF request lifecycle?
Date Fri, 28 Apr 2006 18:17:34 GMT
On 4/27/06, 王曾wang_zeng <> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message