title: Dynamic key in bean:message in Struts 1.3
body: <p>I am working on a project which made use of an old (but nice) framework Struts 1.3, and I am trying to accomplish a simple task.</p>
  
  <p>I have a bean containing a property, which is a key corresponding to a property file. I would like to use it for recall the appropriate translation.</p>
  
  <p>Variable in property file</p>
  
  <pre><code>props.myprop.sample=This is my sample property
  </code></pre>
  
  <p>The property is in a bean passed to the jsp called for convenience AllProps which has a getter for the property, and this should be a pseudo code:</p>
  
  <pre><code>&lt;bean:define id="sample" name="AllProps" property="sample" type="java.lang.String"/&gt; // should result in sample = props.myprop.sample
  
  &lt;div&gt;&lt;bean:message key="sample"/&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Which should output:</p>
  
  <pre><code>&lt;div&gt;This is my sample property&lt;/div&gt;
  </code></pre>
  
  <p>But obviously result in a property not found, can you give me help on how to deal with this ?
  I would like to stick as much as possible to Struts tag, then Jsp tag, and scriptlet as last resource.  </p>
  
  <p>Thanks</p>