You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Scott F. Walter" <sc...@vivare.com> on 2005/04/06 20:28:13 UTC
PageRedirectException
I am having a problem with going back to a login page after a session
has timed out. I have a page called MyProtectedPage that all my pages
extend from and MyProtectedPage has the following method:
public void pageBeginRender(PageEvent event) {
super.pageBeginRender(event);
if(getVisit()==null || !getVisit().isLoggedIn()) {
LoginPage loginPage = (LoginPage)
getRequestCycle().getPage("Login");
throw new PageRedirectException(loginPage);
}
}
The problem is that when I do have a session timeout I get the standard
Tapestry exception page indicating an exception has occured instead of
going to my login page. What exactly am I do wrong????
thank, scott.
--
Scott F. Walter Scott F. Walter
Principal Consultant
Vivare, Inc.
E: scott.walter@vivare.com
E: scott@scottwalter.com
Visit scottwalter.com <http://scottwalter.com> --Point. Click. Explore!
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: PageRedirectException
Posted by Paul Ferraro <pm...@columbia.edu>.
Your MyProtectedPage should implement PageValidateListener. Move this
logic into the corresponding pageValidate(PageEvent) method.
Paul
Scott F. Walter wrote:
> I am having a problem with going back to a login page after a session
> has timed out. I have a page called MyProtectedPage that all my pages
> extend from and MyProtectedPage has the following method:
>
> public void pageBeginRender(PageEvent event) {
> super.pageBeginRender(event); if(getVisit()==null
> || !getVisit().isLoggedIn()) {
> LoginPage loginPage = (LoginPage)
> getRequestCycle().getPage("Login");
> throw new PageRedirectException(loginPage);
> } }
>
> The problem is that when I do have a session timeout I get the
> standard Tapestry exception page indicating an exception has occured
> instead of going to my login page. What exactly am I do wrong????
>
> thank, scott.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org