title: dynamically change spring beans
body: <p>how do I dynamically change the properties of a bean at runtime using java spring?
  I have a bean mainView, which should use as property "class" either "class1" or "class2".
  This decision should be made on base of an property-file, where the property "withSmartcard" is "Y" or "N".</p>
  
  <p>ApplicationContext:</p>
  
  <pre><code>&lt;bean id="mainView"
      class="mainView"&gt;
      &lt;property name="angebotsClient" ref="angebotsClient" /&gt;
      &lt;property name="class" ref="class1" /&gt;
  &lt;/bean&gt;
  
  
  
  &lt;bean id="class1"
      class="class1"&gt;
      &lt;constructor-arg ref="mainView" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="class2"
      class="class2"&gt;
      &lt;constructor-arg ref="mainView" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>PropertyFile:</p>
  
  <p>withSmartcard=Y</p>