response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
response.setHeader(Cache-Control,no-store); response.setHeader(Pragma,no-cache); response.setDateHeader (Expires, 0);
Share
You need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. You can do this by executing the following scriptlet at the beginning of your JSP pages to prevent them from being cached at the browser. You need both the statements to take care of some of the older browser versions.
The same effect can be achieved by using meta tags in the HTML header:
You can refer here for more information.