2010-08-22 4 views

답변

1

원하는 작업을 정확하게 수행할지 모르겠지만 요청을 처리하기 전에 값을 설정하려면 setInitialRequestStrategy와 함께 WebClientSpec을 사용하십시오.

WebClientSpec wcSpec = new WebClientSpec("/secure.jsp"); 
     FormAuthenticationStrategy formStrategy = new FormAuthenticationStrategy("user", "password"); 
     formStrategy.setSubmitComponent("login_button"); 
     wcSpec.setInitialRequestStrategy(formStrategy); 
     JSFSession jsfSession = new JSFSession(wcSpec); 

또는 InitialRequestStrategy를 구현하는 사용자 정의 요청 전략을 정의 :

예를 들어, FormAuthenticationStrategy를 사용할 수 있습니다.

FormAuthenticationStrategy 코드를 참조하고 비슷한 코드를 만드십시오.

+0

이 또한 관리 빈에 사용할 수 있습니까? –

관련 문제