I am running Tomcat 7 with apache in front of it. They are hooked up with mod_jk. I recently changed my code and one jsp changed. I checked the jsp (inside tomcat war) and it is correct, but when it renders it is clearly using the old version of the jsp. Also many of my jsps are not loading. I get a 404 error that it can't find the jsp. I can refresh a couple times and finally get the jsp to load and everything loads properly.
I've added
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0);
headers but it didn't do anything. I also added this code to the web app initializer
@Override public void onStartup(ServletContext servletContext) throws ServletException {
servletContext.setInitParameter("weblogic.jsp.pageCheckSeconds", "0");
super.onStartup(servletContext);
}
So the problem was that the $TOMCAT_HOME/work folder was behaving strangely. It needed to be cleared out as is necessary every so often when changing around your jsps on the server. I found this link which solved my problem.