title: Why is the ${} variable not interpreted as a constructor-arg value, in my context file?
body: <p>I have a Spring 3.1 application, and I try to use a system variable in the context files. The variable "JAVA_MY_ENV" is defined on my System (on Windows, it is in the "System variables", from the control panel). </p>
  
  <p>In web.xml, I can use it as a variable and it works, it is successfully replaced by the actual value of the variable (let's say "electrotype") :</p>
  
  <pre><code>&lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.util.Log4jConfigListener&lt;/listener-class&gt;
  &lt;/listener&gt; 
  &lt;context-param&gt;
      &lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;classpath:log/${JAVA_MY_ENV}.log4j.properties&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>I can also use it in my main "bean" context, to do an import, and it also works :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:context="http://www.springframework.org/schema/context"       
          xmlns:tx="http://www.springframework.org/schema/tx" 
          xsi:schemaLocation="http://www.springframework.org/schema/beans
                              http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                              http://www.springframework.org/schema/context
                              http://www.springframework.org/schema/context/spring-context-3.1.xsd
                              http://www.springframework.org/schema/tx
                              http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"&gt;
  
      &lt;!-- (...) --&gt;
  
      &lt;import resource="classpath:spring/app-config.xml" /&gt;
      &lt;import resource="classpath:spring/env/context-env-${JAVA_MY_ENV}.xml" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>But In "app-config.xml", one of my other context file, I try this and it <em>doesn't</em> work :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:context="http://www.springframework.org/schema/context"       
          xmlns:tx="http://www.springframework.org/schema/tx" 
          xsi:schemaLocation="http://www.springframework.org/schema/beans
                              http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                              http://www.springframework.org/schema/context
                              http://www.springframework.org/schema/context/spring-context-3.1.xsd
                              http://www.springframework.org/schema/tx
                              http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"&gt;
  
      &lt;bean id="appConfiguration" class="com.xxx.app.AppConfiguration"&gt;
          &lt;constructor-arg value="${JAVA_MY_ENV}" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>The com.xxx.app.AppConfiguration receives the String "${JAVA_MY_ENV}" as the constructor parameter, not the interpreted value of it!</p>
  
  <p>I'm not sure to understand where the ${} variables are interpreted and where they are not.</p>
  
  <p>Is there a way I can pass the interpreted ${JAVA_MY_ENV} value to my com.xxx.app.AppConfiguration constructor?</p>