我已经找到了解决我的麻烦的解决方案大约3个小时,但是找不到那个! 这是我的security-context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd">
<http auto-config="true">
<intercept-url pattern="/admin**"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="ivan" authorities="ROLE_USER" password="ivan"/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
我的pom.xml片段:
<properties>
<spring-version>4.1.0.RELEASE</spring-version>
<spring-security-version>3.2.5.RELEASE</spring-security-version>
<hibernate-version>4.3.4.Final</hibernate-version>
</properties>
...
<!-- Spring security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring-security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring-security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring-security-version}</version>
</dependency>
弹簧和弹簧安全版本之间的兼容性问题是什么?或其他什么?
答案 0 :(得分:0)
抱歉!我找到了解决方案!我应该添加下一个依赖项:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring-security-version}</version>
</dependency>