Hi all,

    I try a simple Page that always produces Exception:

public class TestError extends WebPage {
    public TestError() {
        throw new NullPointerException();
    }
}

Then I add a link to TestError:

public class FooPage extends MyBaseWebPage {
    public FooPage() {
        add(new PageLink("testpage", TestError.class));
    }
}

Ideally, click link "testpage" should redirect to InternalErrorPage, But I only got a HTTP Status 500.
Wicket responses that it can't do redirect because it already redirected, and :

wicket.WicketRuntimeException: Already redirecting to '/myContext/myApp?path=9&bid=23453204'. Cannot redirect more than once
    at wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:88)
    at wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:192)
    at wicket.request.target.PageRequestTarget.respond (PageRequestTarget.java:64)
....

If I change to BookmarkablePageLink:

       add(new BookmarkablePageLink("testpage", TestError.class));

then InternalErrorPage rendered correctly.

Do I miss something ?

Thanks in advance.

Note: my version of Wicket is CVS HEAD in mid December, not latest HEAD.

--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen

Reply via email to