Avoid back button after Spring login

I was looking for a specific Spring feature that can prevent a user from returning to a restricted area using the back button after logging out. I haven't found anything.

Is there a Spring special function to handle my problem, or should I use response.setHeader(.....

etc.

+3


source to share


1 answer


There is no direct function in spring, you can use interceptor

to do the job. like your servlet filters set the parameter cacheSeconds

to 0

<mvc:annotation-driven/>
<mvc:interceptors>
    <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:interceptors>

      



that explains WebContentInterceptor

. and also great expansion here.

+1


source







All Articles