I believe you can do this by having onActivate() return a Page, or just
the string name of your page:
public String onActivate() {
... test for condition
if (condition) {
return "MyPageName";
} else {
return null; // keeps you on this page
}
}
onActivate() is called before any rendering.
-----Original Message-----
From: Hugo Palma <[email protected]>
Reply-to: "Tapestry users" <[email protected]>
To: Tapestry users <[email protected]>
Subject: Redirecting to page on load
Date: Mon, 8 Nov 2010 11:43:11 +0000
I would like for a given page to force a redirect to a different page before
it's rendered if a given condition is met.
I could use a simple Response.sendRedirect but that would mean i would have
to provide the page name in string format. I would like to avoid having to
do this because it would make code refactoring harder and more error prone.
So, any way i can redirect using page classes only ?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]