Description
We have exceptions that restart a response and go to a different page, or to an intercept page. But we can't redirect to an external site.
public class RedirectToExternalException extends AbstractRestartResponseException
{
private static final long serialVersionUID = 1L;
public RedirectToExternalException(String url)
{
RequestCycle rc = RequestCycle.get();
if (rc == null)
else
{
Response r = rc.getResponse();
if (!(r instanceof WebResponse))
// abort any further response processing
rc.setRequestTarget(new RedirectRequestTarget(url));
}
}
}