登录中的多个重定向(Spring MVC)
我正在努力实现: 会话超时后,用户被重定向到登录页面,当他再次登录时,他应该被重定向到用户输入的原始url 问题是: 登录页面中正在发生多个重定向。因此,如果我键入登录中的多个重定向(Spring MVC),spring,spring-mvc,redirect,apache-tiles,Spring,Spring Mvc,Redirect,Apache Tiles,我正在努力实现: 会话超时后,用户被重定向到登录页面,当他再次登录时,他应该被重定向到用户输入的原始url 问题是: 登录页面中正在发生多个重定向。因此,如果我键入http://localhost:8080/app-浏览器中的web/login,然后Fiddler向我显示以下内容: 200/应用程序web/登录 302/应用程序web/0 302/应用程序web/0/ 200/应用程序web/登录 因此,登录后,它会将我重定向到/app web/0/ 我正在使用apachetiles。如果您需要
http://localhost:8080/app-浏览器中的web/login
,然后Fiddler向我显示以下内容:
<http auto-config="true"
use-expressions="true"
disable-url-rewriting="true"
entry-point-ref="ajaxAwareAuthenticationEntryPoint">
<form-login login-processing-url="/resources/j_spring_security_check"
authentication-success-handler-ref="postSuccessAuthHandler"
authentication-failure-handler-ref="postFailureAuthHandler"
login-page="/login"
authentication-failure-url="/login?login_error=t"
default-target-url="/pin"/>
<logout logout-url="/resources/j_spring_security_logout" />
<intercept-url pattern="/resources/**" access="permitAll" />
<intercept-url pattern="/images/**" access="permitAll" />
<intercept-url pattern="/login" access="permitAll" />
<intercept-url pattern="/auth/resetForgotPassword" access="permitAll" />
<intercept-url pattern="/**" access="isAuthenticated()" />
</http>
登录视图:
<mvc:view-controller path="/login"/>
瓷砖:
<definition name="login" extends="NoNav.Template" >
<put-attribute name="NoNavMainBodyContainer" value="LoginMainBodyContainer.Template" cascade="true" />
</definition>
显示如何执行重定向的类和配置。我不知道重定向是如何发生的,但添加了一些配置