title: Why changes to WEB-INF/web.xml does not cause tomcat to reload the context?
body: <p>I have created a Dynamic Web Projects named "test" using Eclipse WTP Tomcat, Eclipse version is Java EE Kepler Service Release 2, Tomcat version is 7.0.53, Servlet 3.0, Win 8.1 x86, jdk 1.6.0_45, but after several tries, I found the problem occurs when matching all the following conditions:</p>
  
  <ol>
  <li>the Webapp(web context) is not in &lt;CATALINA_HOME>/webapps(which is the default value of appBase) and:</li>
  <li>the Webapp is configured by writing a &lt;Context> element in &lt;CATALINA_HOME>\conf\server.xml, under the &lt;Host> element.</li>
  </ol>
  
  <p>Here is part of &lt;CATALINA_HOME>\conf\server.xml：</p>
  
  <pre><code>   &lt;Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"&gt;
  
      &lt;!-- SingleSignOn valve, share authentication between web applications
           Documentation at: /docs/config/valve.html --&gt;
      &lt;!--
      &lt;Valve className="org.apache.catalina.authenticator.SingleSignOn" /&gt;
      --&gt;
  
      &lt;!-- Access log processes all example.
           Documentation at: /docs/config/valve.html
           Note: The pattern used is equivalent to using pattern="common" --&gt;
      &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" prefix="localhost_access_log." suffix=".txt"/&gt;
      &lt;Context docBase="D:/tmpdev/apache-tomcat-7.0.53/wtpwebapps/test" path="/test" reloadable="true"/&gt;
    &lt;/Host&gt;
  </code></pre>
  
  <p>and here is the Directory Structure of "test":</p>
  
  <pre><code>test
  ├─META-INF
  │      MANIFEST.MF
  │
  └─WEB-INF
      │  web.xml
      │
      ├─classes
      │  └─test
      │          HelloServlet.class
      │          MyFilter1.class
      │          MyFilter2.class
      │          MyHttpSessionListener.class
      │          MyServletContextListener.class
      │
      └─lib
  </code></pre>
  
  <p>Although WEB-INF/web.xml is &lt;WatchedResource> in &lt;CATALINA_HOME>\conf\context.xml by default, I tried to add a &lt;WatchedResource> element in each of the following formats, still not works:</p>
  
  <pre><code>&lt;WatchedResource&gt;WEB-INF/web.xml&lt;/WatchedResource&gt;
  &lt;WatchedResource&gt;WEB-INF\web.xml&lt;/WatchedResource&gt;
  &lt;WatchedResource&gt;D:/tmpdev/apache-tomcat-7.0.53/wtpwebapps/test/WEB-INF/web.xml&lt;/WatchedResource&gt;
  &lt;WatchedResource&gt;D:\tmpdev\apache-tomcat-7.0.53\wtpwebapps\test\WEB-INF\web.xml&lt;/WatchedResource&gt;
  </code></pre>
  
  <p>HERE is other configuration ways that works:</p>
  
  <ol>
  <li>use a seperate file &lt;CATALINA_HOME>\conf\Catalina\localhost\test.xml to configure context, or:</li>
  <li>move "test" into &lt;CATALINA_HOME>\webapps without any more configuration, or:</li>
  <li>check "Serve modules without publishing" of Server Options in Eclipse WTP</li>
  </ol>