2016-05-02 9 views
0

を追加した後、エラーを解決できないことは輸入org.springframework.web.bind.annotation.RestControllerは私のpom.xmlに以下の追加「春・セキュリティ・ウェブ」

<dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-web</artifactId> 
     <version>3.0.5.RELEASE</version> 
    </dependency> 

でエラーを解決するには私servlet-config.xml

<http pattern="/api/login" security="none" /> // error line 
// error : The classes from the spring-security-web jar (or one of its dependencies) are not available. You need these to use <http>: 
org.springframework.security.web.FilterChainProxy 

しかし、私はエラーを取得すること上記のエントリ私@RestControllerとポンポンを変更する場合。

ラインで

import org.springframework.web.bind.annotation.RestController; 

それは、最新バージョン(現在は、4.3に

答えて

2

スイッチ "輸入org.springframework.web.bind.annotation.RestControllerがを解決できない" と言います。 3.RELEASE)Spring @RestController注釈は、バージョン4.0.1以降のspring-webでのみ利用可能でした[1]。 Mavenので

これはあなたのpom.xmlファイルで依存関係を置き換え/含む意味します:

<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-webmvc</artifactId> 
    <version>4.3.3.RELEASE</version> 
</dependency> 
+0

は私の一日の感謝を保存:) –

関連する問題