Do you visualize views (JSPs) directly?
If so, add the no-cache directives directly to the JSP:
<% response.setHeader("Cache-Control", "no-cache"); %> ...
Another (preferred) option is to prevent direct access to the JSP and execute them through the controller:
@RequestMapping(value = "/login", method = GET) public String renderLoginPage() { return "login"; }
with this, to allow the presentation by name (string returned from the controller method):
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/views" p:suffix=".jsp" />
with /WEB-IBF/views/login.jsp as a view.
Using the latter approach, you can use the WebContentInterceptor approach to prevent caching.
Also, make sure all requests fall into the Spring Security Filter Chain.
Jukka source share