title: Spring Property Placeholders with String Concatenation
body: <p>My problem looks simple but I'm not able to resolve it. I have a properties file which contains configuration details of all environments (dev, qa, prod). </p>
  
  <p>Example <code>config.properties</code>:</p>
  
  <pre><code>dev.maxLength=2000  
  qa.maxLength=4000
  </code></pre>
  
  <p>We have a parent Properties file which holds the host name, environment mappings.</p>
  
  <p>Example <code>hosts.properties</code>:</p>
  
  <pre><code>host1=dev
  host2=qa
  </code></pre>
  
  <p>The property name <code>host1</code> is stored in a bean <code>hostname</code>.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="hostname"
    factory-bean="localhostInetAddress"
    factory-method="getHostName"/&gt; 
  </code></pre>
  
  <p>To resolve the config properties name I have to join the strings as follows,
  <code>${${**hostname**}.maxLength}</code> which should be resolved as <code>${dev.maxLength}</code></p>
  
  <p>I tried using SpEL with no success. I am getting <code>Could not resolve placeholder</code> Exception. How can I concatenate a bean value in property place holder? How are dynamic property names constructed?</p>
  
  <p><strong>Spring version 3.2</strong></p>