Wicket: how to redirect to another page?

后端 未结 5 1867
花落未央
花落未央 2020-12-24 02:36

How do I redirect to another page using Wicket? IIRC, some exception has to be thrown in the constructor, but I don\'t remember which one. Thanks in advance.

5条回答
  •  不思量自难忘°
    2020-12-24 03:32

    I just found

    getRequestCycle().setResponsePage(MyOtherPage.class);
    

    which is working at least in wicket 6. It works server-side and rewrites the URL too. Maybe it is a bit faster than using an exception.

提交回复
热议问题