在春季安全注销后回来

时间:2014-05-27 09:12:10

标签: spring-mvc spring-security

Hi Project包含spring security mvc应用程序。在我退出后的应用程序中,我可以 点击浏览器后退按钮返回。如何摆脱这个问题????

security.xml安全配置

<security:http use-expressions="true">

        <security:form-login login-page="/home.html"

            default-target-url="/dologin.html" authentication-failure-url="/loginfailed.html" />
        <!-- <security:logout logout-success-url="/home.html" /> -->

        <security:logout logout-success-url="/home.html"
            delete-cookies="JSESSIONID" invalidate-session="true" />
        <security:remember-me />
        <security:intercept-url pattern="/signin*"
            access="permitAll" />
    </security:http>

的web.xml

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring-context-data.xml</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        /WEB-INF/spring-context-web.xml,
         /WEB-INF/spring-context-data.xml,
         /WEB-INF/spring-security.xml
        </param-value>

    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
         /WEB-INF/spring-context-web.xml,
         /WEB-INF/spring-context-data.xml,
         /WEB-INF/spring-security.xml
    </param-value>
</context-param>

<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.html</url-pattern>
</servlet-mapping>
<!-- <servlet>
        <servlet-name>RealEstate</servlet-name>
        <servlet-class>com.Servlet1</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>RealEstate</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping> -->

<filter>

    <filter-name>methodFilter</filter-name>
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>methodFilter</filter-name>
    <url-pattern>*.html</url-pattern>
</filter-mapping>

<!-- Spring Security -->
<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>

<welcome-file-list>

    <welcome-file>index.html</welcome-file>

</welcome-file-list>

HTML

<a href="j_spring_security_logout"  th:action="@{/j_spring_security_logout}"><span>Logout</span></a>

0 个答案:

没有答案
相关问题