title: In Tomcat 8 server.xml config file, is there a way dynamically configure a path to a resource using variable substitution?
body: <p>I am using Apache Tomcat 8.</p>
  
  <p>In <code>$CATALINA_HOME/conf/server.xml</code>, I have a <code>Resource</code> within the <code>GlobalNamingResources</code> tag:</p>
  
  <pre><code>&lt;Resource name="jdbc/myderby"
            auth="Container"
            type="javax.sql.DataSource"
            username=""
            password=""
            driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
            url="jdbc:derby:myderby;create=true"/&gt;
  </code></pre>
  
  <p>But I would like to use my webapp context path as the base path to my database in the <code>url</code> parameter. For example:</p>
  
  <pre><code>url="jdbc:derby:${WEBAPP_HOME}/WEB-INF/db/myderby;create=true"
  </code></pre>
  
  <p>Is this possible and if so, what is the property I would need to set for <code>${WEBAPP_HOME}</code>?</p>