首页 > 编程语言 > 详细

在使用spring security时,解决后退按钮所产生的问题

时间:2015-03-12 15:32:27      阅读:444      评论:0      收藏:0      [点我收藏+]

Spring Security给我们的开发带来了很大的便利,最近在使用的时候,出现了一个问题,在用Spring Security做完权限设置后,在用户退出的情况下,点击浏览器的后退按钮,又再次进入了只有登录才能访问的页面,这个问题要解决,在spring-mvc.xml中加入下面的代码

<mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/**/*"/>
            <bean id="webContentInterceptor" class="org.springframework.web.servlet.mvc.WebContentInterceptor">
                <property name="cacheSeconds" value="0"/>
                <property name="useExpiresHeader" value="true"/>
                <property name="useCacheControlHeader" value="true"/>
                <property name="useCacheControlNoStore" value="true"/>
            </bean>
        </mvc:interceptor>
    </mvc:interceptors>

好了,这样问题就可以解决了,快去试试!

在使用spring security时,解决后退按钮所产生的问题

原文:http://my.oschina.net/sucre/blog/386136

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!