前提・実現したいこと
ここに質問の内容を詳しく書いてください。
SpringSecurityを試したくて既存のSpringを使用したサンプルWebアプリケーションに実装しています。
以下記載の必要な設定を記述し、アプリケーションサーバを起動したところ404エラーとなってしまいます。
アプリケーションはhotel_reserve_systemでログイン時のURLは
http://localhost:8080/hotel_reserve_system/login です。
http://localhost:8080/ でtcServerの画面にアクセスできること、及び、
SpringSecurity設定内容をコメントアウトすると正常に起動しlogin.jspに遷移することは確認済みです。
また既存のapplication-config.xmlと同じクラスパスにsecurity-context.xmlを配置していることも確認済みです。
なので当方のSpringSecurityの知識不足による設定誤りではないかと思い調べていますがなかなか解決できていません。
設定ファイルをだらだらと書いてしまい大変恐縮ではございますがご教授いただければ幸いです。
SpringSecurity設定内容
■pom.xmlの設定抜粋
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${spring-framework.version}</version>
</dependency>
■web.xmlの設定抜粋
<display-name>hotel_reserve_system</display-name>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
■security-context.xmlの設定抜粋
sec:http
<sec:intercept-url pattern="/**" access="isAuthenticated()"/>
sec:form-login/
</sec:http>
sec:authentication-manager</sec:authentication-manager>
あなたの回答
tips
プレビュー