title: Substitute web.xml variables at startup
body: <p>I have a web.xml file that constains variables in context-param and init-param of filters. I want to replace this variable with values taken from a properties file at application's startup.</p>
  
  <p>My web.xml is like that:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"&gt;
  
  &lt;display-name&gt;APP NAME&lt;/display-name&gt;
  &lt;description&gt;
      App description
  &lt;/description&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;my-param-name&lt;/param-name&gt;
      &lt;param-value&gt;${my-param-name}&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;Authentication Filter&lt;/filter-name&gt;
      &lt;filter-class&gt;my.app.Filter&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;filter-var-name&lt;/param-name&gt;
          &lt;param-value&gt;${filter-var-value}&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  ...
  &lt;/web-app&gt;
  </code></pre>
  
  <p>And the web.properties</p>
  
  <pre><code>my-param-name=${PARAM_VALUE_TO_BE_SETTED_BY_TOOL}
  filter-var-value=${FILTER_VALUE_TO_BE_SETTED_BY_TOOL}
  </code></pre>
  
  <p>Here is how the deployment works:</p>
  
  <p>1) A deployment tool read a given properties file and replace variables with PROD or Dev values (values setted in that tool) and push the file to application module under a JBoss;</p>
  
  <p>2) Start application's deployment on a JBoss. I want that web.xml variables be substituted by properties file values on startup. </p>
  
  <p>Thanks in advance.</p>