그래서 wicket의 AuthenticatedWebSession을 확장하는 클래스에서 스프링 빈을 초기화하려고합니다.wicket의 AuthenticatedWebSession에서 봄 빈 시작하기
stakcoverflow에는 몇 가지 답변이 있지만 나에게 도움이되지 못합니다.
public class AuthWebSession extends AuthenticatedWebSession {
@SpringBean(name = "authenticationService")
private AuthenticationService authenticationService;
public AuthWebSession(Request request) {
super(request);
Injector.get().inject(this);
}
@Override
protected boolean authenticate(String username, String password) {
//authenticationService is null here as the spring bean did not initiate
authenticationService.auth(username, password);
}
...
}
authentication bean은 스프링 bean이 시작되지 않았으므로 널입니다. 개찰판 버전 7.3.0 사용
정확하게 주입하는 방법에 대한 아이디어가 있습니까?
검사 할 패키지를 사용하면서 XML 파일에''이 있습니까? –
VinayVeluri
Bean을'extends Base' 클래스에 포함 시키면 bean이 발견됩니다. 따라서 문제는 component-scan과 관련되어서는 안됩니까? – Noripsni