spring security配置,web.xml顺序问题
今天在学习spring security时遇到一个问题:
<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/classes/JDBC-context.xml /WEB-INF/classes/spring-security.xml </param-value> </context-param>
security配置文件spring-security.xml放在后面时报错:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.spring.security.IChangePassword] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
而将配置文件spring-security.xml放在前面时则正常。