That is true.  But, ideally you shouldn't need to access their session
anywhere in a Tapestry application.  All of that sort of stuff is handled
for you.

-----Original Message-----
From: Skriloff, Nicholas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 23, 2006 2:50 PM
To: Tapestry users
Subject: Cycle Question

Thanks Ken for the answer.      

Next Question: In tapestry when does the cycle have the user's session
in scope? 
When you get a tapestry page or component, they both implement this tree
except a that components begin at BaseComponent
BaseLocatable (org.apache.tapestry.spec)
AbstractComponent (org.apache.tapestry)
BaseComponent (org.apache.tapestry)
AbstractPage (org.apache.tapestry)
BasePage (org.apache.tapestry.html)

For example, suppose that I have a listener on a page like
    public void search(IRequestCycle cycle) {
                 cycle.getRequestContext().getRequest().getSession();
                // do a search
    }

Suppose I am in a component and I say
getPage().getRequestCycle().getRequestContext().getRequest().getSession(
);

It seems from the class hierarchy that the users session is always
available anywhere? Is that true? 


-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Kent Tong
Sent: Thursday, February 23, 2006 5:43 AM
To: [email protected]
Subject: Re: PageBeginRender vs RenderComponent

Skriloff, Nicholas <SkriloffN <at> darden.virginia.edu> writes:

> What is the purpose of implementing pageRenderListener ,and when in
the
> request lifecycle does it happen(what event happens before and after
> it), in a java class implemented by a .PAGE file?
> What is the purpose of implementing pageRenderListener, and when in
the
> request lifecycle does it happen (what event happens before and after
> it), in a java class implemented by a .JWC file?

If a component is in a page and implements PageBeginRenderListener,
then its pageBeginRender() method will be called before the page 
starts to render. Note that the component later may end up rendering
itself 0 time (if it is contained in an IF), once or many times 
(in a For). If you need to perform something every time before it's 
rendered, you should implement preapreForRender() instead (no need to 
override renderComponent).

In pageBeginRender() the component usually performs something that 
needs to be done exactly once, no matter how many times it will be 
rendered (eg, reading data from Visit or loading a small DB table).

--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to