Pages are apparently being requested in the browser cache. You will need to disable client-side caching on the relevant pages. You can do this by creating a Filter that listens for the url-pattern pages you want to disable the cache on, for example *.jsp . Complete the following steps in the doFilter() method:
HttpServletResponse httpres = (HttpServletResponse) response; httpres.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. httpres.setHeader("Pragma", "no-cache"); // HTTP 1.0. httpres.setDateHeader("Expires", 0); // Proxies. chain.doFilter(request, response);
Thus, the client application will be instructed not to cache requests matching the url-pattern this filter. When you click on the "Back" button, a real request from the server with the proposed new data will be forcibly submitted. To save specific server data between requests, you need to capture the session area or use only GET requests.
Oh, do not forget to clear the browser cache first after implementation and before testing;)
source share