我的spring-security.xml
文件有问题。我想配置一些会话设置,首先创建登录表单来维护访客和登录用户。
这是我的spring-security.xml
标题:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
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.1.xsd">
如您所见,我正在使用最新版本的 Spring Security - 3.1。当我尝试将架构版本更改为更低时,我遇到了错误。就 3.1 版本而言,我在 Eclipse 中只有黄色警告。
我的http
标签看起来像:
<security:http auto-config='true'>
<security:intercept-url pattern="/wellcome*" access="ROLE_USER" />
<security:form-login login-page="/login" default-target-url="/wellcome" authentication-failure-url="/loginfailed" />
<security:logout logout-success-url="/logout" />
<security:session-management invalid-session-url="/invalidsession" />
</security:http>
在这个标签的第一行,我有一长串警告:
Multiple annotations found at this line:
- Method 'setAuthenticationEntryPoint' is marked deprecated [config set: SpringMVC/web-context]
- Method 'setSessionAuthenticationStrategy' is marked deprecated [config set: SpringMVC/web-
context]
- Method 'setUserAttribute' is marked deprecated [config set: SpringMVC/web-context]
- Method 'setRequestCache' is marked deprecated [config set: SpringMVC/web-context]
- Method 'setKey' is marked deprecated [config set: SpringMVC/web-context]
- Method 'setSecurityContextRepository' is marked deprecated [config set: SpringMVC/web-context]
另外,我在第三行还有一个警告:
Method 'setLoginFormUrl' is marked deprecated [config set: SpringMVC/web-context]
你能解释一下我应该如何在 Spring Security 3.1 中正确定义我的spring-security.xml
文件吗?http