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>
好了,这样问题就可以解决了,快去试试!