How to pick Tomcat context.xml parameter through SpEL expression in Java Code
<p>I am trying to get <code>context.xml</code> parameter through SpEL expresseion but I am getting <code>null</code>.</p>

<p>My code to get paramter is </p>

<pre><code>public class DatabaseProperties extends PropertyPlaceholderConfigurer {

    @Value("#{'${myConfigDirectory}'}")
    private String dbConfigPath;

    @Override
    protected void loadProperties(Properties props) throws IOException 
        Resource location = new FileSystemResource("/spring-data-access.properties");
        System.out.println("DB CONFIG PATH "+dbConfigPath);
        System.out.println("DB LOCATION + "+location.getFile().getAbsolutePath());
        setLocation(location);
        super.loadProperties(props);
    }
}
</code></pre>

<p>here <code>dbConfigPath</code> is always <code>null</code>. </p>

<p>My configuration file is in <code>.xml</code>. here it is</p>

<pre><code>&lt;bean id="propertyConfigurer" class="com.properties.DatabaseProperties"&gt;
    &lt;property name="ignoreResourceNotFound" value="true"/&gt;
&lt;/bean&gt;
</code></pre>

<p>I need to do it so that when a <code>war</code> is deployed it should pick properties from outside war using <code>parameter</code> defined in 'context.xm' and when in <code>dev</code> it should pick from <code>resource</code> folder.</p>