you're right, the way to do it is return an ILink which will cause getRequestCycle().sendRedirect(link.getAbsoluteURL())

What I've been doing until beta-7 source is my BasePage class has redirectTo/externalRedirectTo methods and I inject PageService or ExternalService into any page that uses these methods; which most do because I do a redirect from my listener methods.

so, i'll change my listeners to return ILink and change the BasePage methods to provide the ILink.

Thank you,
~eli.

Tomás( Drenc(ák wrote:

I'm not sure if you can throw a RedirectException from listener
method. If you need redirect, just return ILink from listener method
which redirects your request.

@InjectObject("engine-service:page")
public abstract IEngineService getPageService();

@InjectPage("SomePage")
public abstract IPage getSomePage();

public ILink doSmth() {
      return getPageService().getLink(getRequestCycle(), false, getSomePage());
}

2005/9/15, Eli Doran <[EMAIL PROTECTED]>:
anyone else having trouble with RedirectExceptions when called from a
listener method? mine are being caught and displayed in the exception
page. i'm using the most recent TP4 source. it works fine from
pageValidate methods.

~eli

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to