You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vince Marco <vm...@mac.com> on 2003/08/08 23:12:22 UTC

Forwarding to a page

I am forwarding to a page from the pageBeginRender(IRequestCycle cycle) 
method.

I do a cycle.activate("MyNextPage"), but I do not get to the next page.  
Is there some sort of flush I need to do?  It seems this has worked from 
an action method, why wouldn't it work from a pageBeginRender()?  My log 
statements indicate it is getting to the statement.

Vince



Re: Forwarding to a page

Posted by Geoff Longman <gl...@intelligentworks.com>.
Do you mean that you want the interrupt the rendering of the current page?

I think you need to throw a PageRedirectException after calling
cycle.activate()

Geoff
----- Original Message -----
From: "Vince Marco" <vm...@mac.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, August 08, 2003 5:12 PM
Subject: Forwarding to a page


> I am forwarding to a page from the pageBeginRender(IRequestCycle cycle)
> method.
>
> I do a cycle.activate("MyNextPage"), but I do not get to the next page.
> Is there some sort of flush I need to do?  It seems this has worked from
> an action method, why wouldn't it work from a pageBeginRender()?  My log
> statements indicate it is getting to the statement.
>
> Vince
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


Re: Forwarding to a page

Posted by Vince Marco <vm...@mac.com>.
Perhaps I am overlooking some documentation on the subject of page 
forwarding.

Is there a better method/listener to use for page forwarding?  I have 
tried pageBeginRender() and pageValidate().  I would think that 
validation might enable me to forward, but that also seems a bit of a 
kludge and doesn't work. (same results)

I am leery of throwing an exception to do the routing, but if that is 
the only way to get it to work, I'll do it.  Exceptions generally 
shouldn't be used for normal app flow.

Howard, I'm not sure what you mean by "from your listener method".  I've 
tried pageBeginRender() and pageValidate() to no avail.  Do you mean a 
listener on a submit?

Just to be clear about my situation, this is in the Home page, and I 
need to route to various pages based upon incoming request parameters.  
This is a direct port of an existing app, so I can't change the final 
behavior.  Also, this routing logic should apply every time I invoke the 
Home page.

Why is it too late to activate a new page?  I would think that before 
rendering would be an excellent time to activate a new page.  Is there a 
listener method that is called while it is possible to activate a new 
page?  My assumption is that initialize() and finishLoad() aren't 
appropriate because I need this to execute upon every call to the page.

>By the time that pageBeginRender() is invoked, it's too late to activate a new page; you should
>throw a PageRedirectException instead; though the best way would be to activate() the right page
>from your listener method (if one is involved).
>
>You should add a bug; Tapestry should throw an exception if you activate() at such an inappropriate
>time.
>  
>
What is the process for submitting a bug?

Vince



RE: Forwarding to a page

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
By the time that pageBeginRender() is invoked, it's too late to activate a new page; you should
throw a PageRedirectException instead; though the best way would be to activate() the right page
from your listener method (if one is involved).

You should add a bug; Tapestry should throw an exception if you activate() at such an inappropriate
time.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Vince Marco [mailto:vmarco@mac.com] 
> Sent: Friday, August 08, 2003 5:12 PM
> To: Tapestry users
> Subject: Forwarding to a page
> 
> 
> I am forwarding to a page from the 
> pageBeginRender(IRequestCycle cycle) 
> method.
> 
> I do a cycle.activate("MyNextPage"), but I do not get to the 
> next page.  
> Is there some sort of flush I need to do?  It seems this has 
> worked from 
> an action method, why wouldn't it work from a 
> pageBeginRender()?  My log 
> statements indicate it is getting to the statement.
> 
> Vince
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>