Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
登录中的多个重定向(Spring MVC)_Spring_Spring Mvc_Redirect_Apache Tiles - Fatal编程技术网

登录中的多个重定向(Spring MVC)

登录中的多个重定向(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。如果您需要

我正在努力实现:

会话超时后,用户被重定向到登录页面,当他再次登录时,他应该被重定向到用户输入的原始url

问题是:

登录页面中正在发生多个重定向。因此,如果我键入
http://localhost:8080/app-浏览器中的web/login
,然后Fiddler向我显示以下内容:

  • 200/应用程序web/登录
  • 302/应用程序web/0
  • 302/应用程序web/0/
  • 200/应用程序web/登录
  • 因此,登录后,它会将我重定向到/app web/0/

    我正在使用apachetiles。如果您需要有关配置的更多信息,我们将非常感谢您的帮助,并让我知道

    编辑

    以下是一些配置文件:

    <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>
    
    
    
    显示如何执行重定向的类和配置。我不知道重定向是如何发生的,但添加了一些配置