私は春のセキュリティ4を認証に使用しています。 私はログインページにリダイレクトできますが、その後は私はさらに移動できませんこのlocalhostのページはここ春のセキュリティを使用して認証できません。資格情報を入力した後
は私のweb.xmlのである。ここ
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>self-thin-client</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/security.xml</param-value>
</context-param>
<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>/rs/self/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>dspature</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dspature</servlet-name>
<url-pattern>/rs/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Initializer</servlet-name>
<servlet-class>com.store.Initializer</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
</web-app>
は私のsecurity.xmlが
<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-4.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.0.xsd">
<!-- Spring MVC based authentication, login page etc. -->
<http>
<intercept-url pattern="/**" access="hasRole('ROLE_ADMIN')"/>
<form-login login-page="/rs/login" login-processing-url="/j_spring_security_check"
authentication-failure-url="/login" />
<logout logout-success-url="/login"/>
</http>
<!-- Declared authentication manager -->
<authentication-manager alias="authenticationManager">
<authentication-provider ref="AuthenticationManager" />
</authentication-manager>
<!-- Bean implementing AuthenticationProvider of Spring Security -->
<beans:bean id="AuthenticationManager" class="com.radix.server.login.AuthenticationManager">
</beans:bean>
</beans:beans>
で見つけることができませんここでは0
が私のHTMLフォーム、
<form method="post" action="/j_spring_security_check" >
<p>
<span>Username:</span>
<input type="text" name= "j_username" >
</p>
<p>
<span>Password:</span>
<input type="password" name= "j_password" >
</p>
<p>
<input type="submit" value="submit">
</p>
</form>
である私は、問題がURLマッピングであるかもしれないと思いますが、私はそれと間違って何をしたか、それを把握することはできないんだけど、それ
私には意味がありません。質問を投稿した最初の問題がログインが正しく機能していなかった場合、ログインはどのように機能しなくなりましたか?実際には、あなたの設定を読んでも、 '/ rs/self'や'/rs'は実際にあなたのコンテキスト名であったとは言いません...もし本当にアプリケーションのコンテキスト名であれば、 'security:http'要素を構成しており、内部の' intercept-url'要素です。最後に 'rs'や' rs/self'があなたのアプリケーションコンテキスト/ war名であれば 'web.xml'や' security.xml'や他のコントローラで使うマッピングURLに含めないでください。 – jlumietu
jsp形式のログイン/ rs/self/j_spring_security_checkでハードコーディングしています。もし私が
の代わりにcontext.xml}/j_spring_security_check ">フィルタをsecurity.xmlにリダイレクトすることはできません –