You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Hamilton <mi...@gentoo.co.nz> on 2004/06/01 23:07:09 UTC

Badly named PageRedirectException - needs documenting or fixing

>From the existing javadoc, and from its name, one would 
expect PageRedirectException to cause a real browser 
redirect - but this is not the case.  

The difference between a real redirect and the result of 
PageRedirectException is subtle and therefore a little 
confusing - the original discussion was prompted by the
differing behavior of the browser reload button in
a fake versus real redirect.

I would suggest that this be documented with a reference
to RedirectException as an alternative.  An option to 
have PageRedirectException generate a real redirect might
also be useful.

On Tue, 01 Jun 2004 15:42, Michael Hamilton wrote:
> I answered my own question.  It's been a while since I've
> done any web work and I'd forgotten this subtlety of the
> request/response cycle.
>
> As for Sean's question, I've confirmed that
>
>   throw new RedirectException("/JWorkTime");
>
> does result in a redirect to a new page where the reload
> works as desired.  And that
>
>   throw new PageRedirectException("Home");
>
> doesn't - this is because  handlePageRedirectException()
> in org.apache.tapestry.engine.AbstractEngine just uses
> a cycle.activate(page) - so it isn't a redirect in the true
> http sense of the word.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Badly named PageRedirectException - needs documenting or fixing

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Hi Michael,

I added a bug earlier today requesting an IPage parameter for the
RedirectException constructor. But ideally, there should be only one
RedirectException, perhaps with a Boolean "persistent" flag, causing the
redirection to be, uhm, persistent. The old PageRedirectException should
then be deprecated. But that is just my idea of how it should be done. Too
bad I had not thought about this earlier today when I added the bug.

-Filip S. Adamsen

> -----Original Message-----
> From: Michael Hamilton [mailto:michael@gentoo.co.nz]
> Sent: Tuesday, June 01, 2004 11:07 PM
> To: Tapestry users; sean chen
> Subject: Badly named PageRedirectException - needs documenting or fixing
> 
> >From the existing javadoc, and from its name, one would
> expect PageRedirectException to cause a real browser
> redirect - but this is not the case.
> 
> The difference between a real redirect and the result of
> PageRedirectException is subtle and therefore a little
> confusing - the original discussion was prompted by the
> differing behavior of the browser reload button in
> a fake versus real redirect.
> 
> I would suggest that this be documented with a reference
> to RedirectException as an alternative.  An option to
> have PageRedirectException generate a real redirect might
> also be useful.
> 
> On Tue, 01 Jun 2004 15:42, Michael Hamilton wrote:
> > I answered my own question.  It's been a while since I've
> > done any web work and I'd forgotten this subtlety of the
> > request/response cycle.
> >
> > As for Sean's question, I've confirmed that
> >
> >   throw new RedirectException("/JWorkTime");
> >
> > does result in a redirect to a new page where the reload
> > works as desired.  And that
> >
> >   throw new PageRedirectException("Home");
> >
> > doesn't - this is because  handlePageRedirectException()
> > in org.apache.tapestry.engine.AbstractEngine just uses
> > a cycle.activate(page) - so it isn't a redirect in the true
> > http sense of the word.
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org