title: How to reference a constant in Spring Expression Language
body: <p>i am quite new to Spring and i have a bean declaration as follows.</p>
  
  <pre><code>    &lt;bean id="mybean" class="" scope="prototype"&gt;
         &lt;property name='typeOf' value='#{typeOfBuilder.getKeyFor("OPEN_DATE").getId()}'/&gt;    
  &lt;/bean&gt; 
  </code></pre>
  
  <p><code>typeOf</code> is a type of Integer which is the key of another table which <code>typeOfBuilder</code> builds by <code>Key</code> which is <code>OPEN_DATE</code> in this case.</p>
  
  <p>this code works OK but have a limitation. <code>OPEN_DATE</code> is a constant in a <code>NON-MANAGE Spring Bean</code> something like follows.</p>
  
  <pre><code>public final class Constants
  {
       public final static String KEY_FOR_OPEN_DATE = "OPEN_DATE";     
  } 
  </code></pre>
  
  <p>and is strongly recommend to be able to reference to it!!.</p>
  
  <p>something like this.</p>
  
  <pre><code>&lt;util:constant id="PATH_TO_CONSTANT" static-field="myPath"/&gt;
  &lt;property name='typeOf' value='#{typeOfBuilder.getKeyFor(PATH_TO_CONSTANT).getId()}'/&gt;  
  </code></pre>
  
  <p>any help is hugely appreciate.</p>