Rahul Ba wrote:
I am forwarding to log out page by using following line
<a class="topNav" href="<%=request.getContextPath()%>/logout.html">Logout
Already, I do have following code in all jsp. but still when do browser back it shows me cached page.
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "must-revalidate");
Thanks once again
Rahul
Why dont you try using this
The forward method of RequestDispatcher will forward the ServletRequest and ServletResponse that it is passed to the path that was specified in getRequestDispatcher(
String path). The response will not be sent back to the client and so the client will not know about this change of resource on the server. This method is useful for communicating between server resources, (
servlet to servlet). Because the request and response are forwarded to another resource all request parameters are maintained and available for use. Since the client does not know about this forward on the server, no history of it will be stored on the client, so using the back and forward buttons will not work.