私は@ComponentアノテーションでアノテーションされたSpringクラスを持っています。そして私は、ローカル変数にbeanを注入する必要があります。 @Component SpringクラスにマネージドBeanまたはEJB varを挿入するにはどうすればよいですか?あなたのコンテキストは、注釈の設定とあなたが注入しようとしている豆のために設定されているとするとマネージドBeanを@Component Springクラスに挿入するにはどうすればよいですか?
@Component
public class AppInternetAuthenticationProvider implements AuthenticationProvider, Serializable {
private IAutenticacaoBO autenticacaoBO;
public void setAutenticacaoBO(IAutenticacaoBO autenticacaoBO) {
this.autenticacaoBO = autenticacaoBO;
}
public AppInternetAuthenticationProvider() {
}
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
// I need inject here
あなたの 'IAutenticacaoBO'は' Spring'によって管理されていますか? –
'spring-security.xml'で宣言されたフィールドを挿入するために使用されるインターフェイスです。 – BicaBicudo
そうなら、@ ced-bからの答えが働くはずです。 –