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 <hugo.m.pa...@gmail.com>
Reply-to: "Tapestry users" <users@tapestry.apache.org>
To: Tapestry users <users@tapestry.apache.org>
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: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to