IExternalPages are handled by the ExternalService.  All engine services
can provide a link to a particular page.  Assuming you're using
annotation (caveat...I'm typing this directly into the email, so no
guarantees that it works, but the concept is correct):

@InjectObject( "engine-service:external")
public abstract IEngineService getExternalService();

public void RedirectToExternalPage( IRequestCycle cycle, String
pageName,                                               Object[] params
)
{
        ExternalServiceParameter esp = 
                        new ExternalServiceParameter(pageName, params);

      String url = getExternalService.getLink( cycle, false, esp
).getURL();
        throw new RedirectCallback( url );
}

jeff    

-----Original Message-----
From: Spencer Crissman [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 11, 2005 8:22 AM
To: Tapestry users
Subject: Redirect to IExternalPage link?

What is the most direct method of generating an IExternalPage url from
within a listener method in Tapestry 4?

I believe I want to throw a RedirectException to the page after a form
submission in order to prevent form resubmission and whatnot, but I am
having a hard time finding how to get the URL to an external page short
of
trying to guess it and construct it manually. It seems like there has to
be
a way to build the "official" link given the page name and the Object[]
of
parameters, but I haven't been able to find an example that works in
Tap4.

Thanks in advance,

Spencer

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

Reply via email to