Tomcat 8 - context.xml use Environment Variable in Datasource : <p>I have a Tomcat 8 project that uses a datasource (see below)</p>

<pre><code>&lt;Resource auth="Container" 
          name="jdbc/JtmDS"  
          driverClassName="org.apache.derby.jdbc.EmbeddedDriver" 
          type="javax.sql.DataSource" 
          username="xfer"
          password="xfer10" 
          url="jdbc:derby:/home/PUID/tm/control/JtmDB"                    
          initialSize="25"
          maxTotal="100" 
          maxIdle="30" 
          maxWaitMillis="10000"                                      
          removeAbandonedOnBorrow="true"
          removeAbandonedTimeout="20" /&gt;
</code></pre>

<p>This works perfectly well. </p>

<p>However the url is a hard-coded path <code>/home/PUID/tm/control/JtmDB</code></p>

<p>When this gets into production the PUID part of the path will differ across numerous systems. 
I have an environment variable set <code>export PUID=abcd</code>
The rest of the application is able to use things like <code>System.getenv( )</code> or <code>${env:PUID}</code> as and where appropriate.</p>

<p>These all work fine.</p>

<p>My question is very simply: 
How can I make the PUID value in my context.xml a variable that can be read from an environment variable?</p>
