【发布时间】:2011-03-26 06:26:37
【问题描述】:
这是我的 spring 安全文件
<!-- 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" />
这运行良好,我想问一下,如果我在 CustomUserDetailsService 上使用@Service,那么我可以删除 bean 行表单 xml 文件,spring security 是否会从注释中读取 bean
【问题讨论】:
标签: java annotations spring-security