title: How to disable application defined via Context element of server.xml in Tomcat?
body: <p>I have a web application defined via <code>&lt;Context&gt;</code> element in my <code>server.xml</code> configuration on Tomcat. I need to be able to automatically disable this application under certain conditions. The change should be effective after tomcat restart or sooner.</p>
  
  <p>Is there some configuration switch that I could use for that purpose? I don't want to completely remove or comment out the <code>Context</code> node because it would add complexity to restoring the application (also done automatically under certain conditions).</p>
  
  <p>I tried <code>deployIgnore</code> attribute of <code>Host</code> element, but it only work for applications that are deployed by copying a war into webapps directory. Application defined via <code>Context</code> is not affected.</p>
  
  <p>I'm using Tomcat 7, if it makes any difference.</p>