title: How do I update the value of an @Autowired String bean in Spring?
body: <p>I have a String that I'm autowiring as a bean.  The value for the <code>String</code> is set via a properties file, and is loaded at runtime.  That much I can verify.  Here's my XML:</p>
  
  <pre><code>&lt;context:property-placeholder location="classpath:my-app.properties" /&gt;
  
  &lt;bean id="loadedProp" class="java.lang.String"&gt;
     &lt;constructor-arg&gt;
        &lt;value&gt;${loaded-prop}&lt;/value&gt;
     &lt;/constructor-arg&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>And in my application, I autowire in the bean:</p>
  
  <pre><code>@Component
  public class Foo {
  
    @Autowired
    private String loadedProp;
  }
  </code></pre>
  
  <p>Everything works dandy.  I have multiple components that autowire in this bean.  What I'm trying to do is, while the application is running, update the value of the bean to be something else, so that everywhere the bean is autowired in, it uses the most up to date value.  Is it possible to do this, or do I just need to restart everytime I want to change the value?</p>