2012-07-05 4 views
5

私のspring-security.xmlファイルに問題があります。いくつかのセッション設定を構成したいと思っていました。まず、ゲストをログインしてログインしているユーザーを管理するためにログインフォームを作成しました。 3.1 - あなたは私が最新バージョンで春のセキュリティを使用しています見ることができるようにSpring Security 3.1でhttpタグを正しく設定する方法は?

<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.xml見出しです。スキーマのversioneを低く変更しようとすると、エラーが発生します。バージョン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] 

Additionaly、私はまた、3行目の1回の警告を持っています:

Method 'setLoginFormUrl' is marked deprecated [config set: SpringMVC/web-context] 

正しく定義する方法を教えてください。spring-security.xmlファイルがhttpタグ付きでSpring Security 3.1にありますか?

答えて

6

EDIT:この問題は今、春のセキュリティ3.1.2で修正されているので、あなたが3.1または3.1.1を使用している場合、新しいバージョンにアップグレードしてください。

オリジナルの答え:

あなたの設定で結構です。それはa known bug in Spring Security with STS in Eclipseです(フォーラムのトピックは、の参考URLに記載されています)。

今のところ、警告を無視してhttps://jira.springsource.orgにログインして問題を投票し、修正されるまで待つか(警告に耐えられない場合はプロジェクトの春の性質を削除してください)。

0
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans" 
    xmlns="http://www.springframework.org/schema/security" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:util="http://www.springframework.org/schema/util" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
     http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd 
     http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> 

<http auto-config="true" disable-url-rewriting="true" use-expressions="true"> 
     <form-login login-processing-url="/login" 
      login-page="/login.html" 
      default-target-url='/index.html' 
      always-use-default-target='true' 
/> 

<logout logout-url="/logout" /> 
+0

警告は同じです。 – woyaru

関連する問題