You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jean-Eric Cuendet <je...@rptec.ch> on 2006/01/02 21:02:05 UTC

PageRedirectException in Components?

Hi,
I have a Border Component and I would like to check 2 things in it:
   - That I'm logged in or not
   - That the Locale is French
If these conditions are not OK, then I would like to redirect to the 
Home page. I did that by throwing a PageRedirectException in 
renderComponent() but that doesn't work. Tapestry says that there is 
then an Uncaught exception...
Any idea how to do it? Where to put that Redirection?
Is it possible to send this Exception from a Component?
Thanks a lot
-jec

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


Re: PageRedirectException in Components?

Posted by Lukas Ruetz <lu...@gmx.at>.
Hi

The usual solution to this is to derive all your pages from your own
base-page class that is derived from BasePage and implements the
PageValidateListener interface.
In the pageValidate() method you can throw a PageRedirectException
to redirect to the login-page.

I've never done this in a component since this approach works well.

lukas



Am Montag, 2. Januar 2006 21:02 schrieb Jean-Eric Cuendet:
> Hi,
> I have a Border Component and I would like to check 2 things in it:
>    - That I'm logged in or not
>    - That the Locale is French
> If these conditions are not OK, then I would like to redirect to the
> Home page. I did that by throwing a PageRedirectException in
> renderComponent() but that doesn't work. Tapestry says that there is
> then an Uncaught exception...
> Any idea how to do it? Where to put that Redirection?
> Is it possible to send this Exception from a Component?
> Thanks a lot
> -jec
>
> ---------------------------------------------------------------------
> 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