我不是很清楚你在问什么,但在这里我们去:
我假设你被弹簧安全的方式保护一些私人的网址,例如:
<security:http use-expressions="true">
<!-- ...more configuration stuff -->
<security:intercept-url pattern="/private/*" access="isFullyAuthenticated()" />
<!-- ...more configuration stuff -->
<security:logout invalidate-session="true" logout-url="/logout" logout-success-url="/yourUrlAfterLogout.html"/>
</security:http>
然后,当用户注销,他无法再访问私人网址。
(UPDATE:Spring Security的一部分完)
如果你想阻止用户访问这些受保护的页面时,他按下返回键在导航或复制的私人网址,你可以配置WebContentInterceptor如下:
<mvc:interceptors>
<bean id="webContentInterceptor"
class="org.springframework.web.servlet.mvc.WebContentInterceptor">
<property name="cacheSeconds" value="-1" />
<property name="useExpiresHeader" value="true" />
<property name="useCacheControlHeader" value="true" />
<property name="useCacheControlNoStore" value="true" />
</bean>
</mvc:interceptors>
我还没有在我的项目中实现spring-security。我需要的是,注销后人们不应该能够访问页面,他们应该能够看到他们通常在没有登录的情况下看到的页面。 通过添加解释来编辑该问题。请检查一下。 – puppuli 2013-03-15 04:58:08
但是你使用spring mvc吗?因为我的答案的第二部分与弹簧安全无关,它只是弹簧mvc。无论如何,我会更新和澄清。 – Dani 2013-03-15 08:21:08