2011-03-25 7 views
0

사용하는 경우이 내 스프링 보안 파일이 잘 실행되고은 내가 주석

<!-- Declare an authentication-manager to use a custom userDetailsService --> 
    <security:authentication-manager> 
      <security:authentication-provider user-service-ref="customUserDetailsService"> 

      </security:authentication-provider> 
    </security:authentication-manager> 

    <!-- Use a Md5 encoder since the user's passwords are stored as Md5 in the database --> 
    <bean class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" id="passwordEncoder"/> 

    <!-- A custom service where Spring will retrieve users and their corresponding access levels --> 
    <bean id="customUserDetailsService" class="com.vaannila.service.CustomUserDetailsService" /> 

입니다 봄 보안 XML에 빈을 선언해야합니까, 내가 CustomUserDetailsService에 @Service를 사용하는 경우 다음 내가 삭제할 수 있음을 물어보고 싶은 bean line form xml file과 spring security는 annotation으로부터 bean을 읽는다.

+1

시도해 보셨습니까? –

+0

나는 그것을 시도하고 그것이 작동하지 않았다. –

답변

0

네, bean을 다른 ApplicationContext로 옮기지 않는다고 가정 할 때 (이것은 <context:component-scan.../> 선언의 위치와 직접 관련이있다).

반대로 id으로 식별되는 Spr Sec 빈의 대부분/대부분은 @Autowired 수 있습니다.