我再次返回一個檢票問題。Wicket - 重定向RestartResponseAtInterceptPageException
在檢票器中實現頁面間重定向的常用方法是通過RestartResponse ... Excepion。
我的應用程序沒有登錄頁面,登錄是由singleSignOn另一個門戶進行的。 我的登錄頁面有2構造:
//bad login if used a direct url to login page that is bookmarkable
public LoginPage() {
super("Login");
throw new RestartResponseAtInterceptPageException(new EmptyPage("Login on SMURFS PORTAL is necessary"));
}
//good login from portal
public LoginPage(PageParameters parameters) {
super("Login");
...
}
空白頁與檢票標籤的非常簡單的頁面:ID =「消息」。
public EmptyPage(String message) {
super("Alert");
add(new Label("message", message));
}
Wicket正確地重定向到空白頁面,但即使頁面的標題是「Alert」,也不會打印空白頁面的代碼。 「子元素」應該附加的部分是空的,就像EmptyPage沒有任何標記。
你有什麼線索嗎?
EmptyPage中的實際內容,因爲上面的代碼不會擴展PageI,而是假設它是一個示例,而不是您已經運行的某個示例。 – Emily