2012-06-08 3 views
0

다시 개찰 문제로 돌아갑니다.Wicket - RestartResponseAtInterceptPageException으로 리디렉션

wicket에서 페이지간에 리디렉션을 구현하는 일반적인 방법은 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)); 
} 

개찰구는 빈 페이지로 올바르게 리디렉션하지만 빈 페이지의 코드는 페이지의 제목은 "경고"인 경우에도 인쇄되지 않습니다. "child"요소가 첨부되어야하는 섹션은 EmptyPage가 마크 업없이 비어 있습니다.

실마리가 있습니까?

+0

위의 코드는 확장되지 않으므로 EmptyPage에 실제로 무엇이 있습니까? 내가 실행 한 예제가 아니라 예를 가정합니다. – Emily

답변

0

내 생각에 this.message은 초기화되지 않은 입력란을 나타냅니다.

+0

죄송합니다. 잘라 내기 및 붙여 넣기 중 문제가 발생했습니다. this.message 대신 메시지를 고려하십시오. 위 코드를 수정했습니다. – MrMime