TomcatExpert

Getting Apache Tomcat to reflect changes immediately

I installed apache tomcat 6 on my server and created my first index page in the ROOT folder and everything worked perfectly. But as soon as I started to attempt to tweek the page to make it look how I wanted it to I noticed that the changes where not being reflected in the borwser and the old page continues to be displayed. Does anyone know why it does this and how it can be fixed so I can see changes immediately?

asked by ts8550

question

There are a number of settings which may apply to your situation.

If the file you are editing is a small 'static' file, Tomcat may be caching it in memory. The attribute values of the Context element which govern this are: cacheMaxSize, cacheObjectMaxSize, cacheTTL and cachingAllowed.

You can find more details about their values in the Tomcat Documentation at: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

If the resource you are editing is a JSP file, then you should check to see if the attributes of org.apache.jasper.servlet.JspServlet in apache-tomcat-6.x/conf/web.xml have been adjusted - it's usual to disable attributes associated with file recompilation during development, before placing the server into production.

Each attribute is well documented in the configuration file, it's worth reading the whole of the standard web.xml to understand more about how Tomcat works.

answer

answered by pidster on June 16, 2011 11:36 AM

Stuart Williams is a Senior Consultant for the SpringSource Division of VMware, Inc. (NYSE: VMW). Stuart has been a Tomcat user for 6 years and is a regular contributor to the Apache Tomcat Users mailing list, and is also a committer on the Apache Amber OAuth project.

Comments

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.