title: When does Tomcat unpack a war file to a ROOT folder?
body: <p>I'm trying to deploy a war on Tomcat 7.0, and in the <code>server.xml</code> file, I've set <code>unpackWARs = true</code> and <code>autoDeploy = true</code>.</p>
  
  <p>Since I want this war file to be the default web application, I have deleted the ROOT folder inside <code>...Tomcat7.0/webapps</code>. Then on, when I try to start the Tomcat service, I see a behavior that I have yet failed to identify a pattern in:</p>
  
  <ul>
  <li>Sometimes, the war is unpacked to a newly created folder named
  'ROOT'. </li>
  <li>Some other times, it is unpacked to a folder that is named
  the same as the name of the war file. E.g. if the war file is
  'MyWebApp.war', it's unpacked to a folder named 'MyWebApp'.</li>
  </ul>
  
  <p>It seems to be completely erratic and random, but I am sure there is method behind this apparent madness. As a rule, I am not sure if there is anything that dictates the creation of a ROOT folder. I have tried to edit the server.xml file and add context to my web application in it, but it doesn't seem to make a difference.</p>
  
  <p>What am I missing? Thanks in advance!</p>