title: Passing a parameter to a bean referenced in a constructor in Spring
body: <p>I want to pass a parameter to a bean referenced from another bean in Spring Context.xml. Is it even possible ?</p>
  
  <p>NOTE : The DISCARD bean would have different values when referenced from different beans.</p>
  
  <pre><code>&lt;bean id="dropBadTimestampFilter" class="TimestampRangeMatcherModifier"&gt;
      &lt;constructor-arg index="0" value="_TIME"/&gt;
      &lt;constructor-arg index="1" ref="DISCARD" /&gt; &lt;!--Want to pass a prameter value to this--&gt;
  &lt;/bean&gt;
  
  &lt;bean id="DISCARD" class="SettingModifier"&gt;
       &lt;property name="fields"&gt;
           &lt;map&gt;
               &lt;entry key="_ORG" value="CONSTANT"/&gt;
               &lt;entry key="CAUSE" value="______"/&gt;  &lt;!-- Want to be passed from bean referring it--&gt;
           &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Is there a way that we could have a reference of bean using a bean using Spring Expression Language so that the following is possible :
      
          
           
      </p>
  
  <pre><code>&lt;bean id="DISCARD" class="SettingModifier"&gt;
       &lt;property name="fields"&gt;
           &lt;map&gt;
               &lt;entry key="_ORG" value="CONSTANT"/&gt;
               &lt;entry key="CAUSE" value="#{dropBadTimestampFilter.CAUSE}"/&gt;  &lt;!-- Can this bean get reference of all the beans using it and not only dropBadTimestampFilter. --&gt;
           &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>