title: Getting Tomcat's "appBase" directory programmatically?
body: <p>By default, appbase is configured to point to TomEE's webapps folder:</p>
  
  <pre><code>&lt;Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true"&gt;
  </code></pre>
  
  <p>I would like to find the location of "appBase" programmatically because it points to different places on our production server and our development boxes (and because it'd just be cleaner that way). </p>
  
  <p>I've researched a few options, and the one that seems to work for others is calling <code>ServletContext().getRealPath("/")</code>. For me this takes me to a temporary folder, <code>$CATALINA_HOME/temp/[#-AppName]</code>, while by default I was looking for <code>$CATALINA_HOME/webapps</code>.</p>