I have a String that I\'m autowiring as a bean. The value for the String
is set via a properties file, and is loaded at runtime. That much I can verify. Here\'s
After reading a few of the other answers and comments, I was able to figure out a solution. I ended up creating a simple class:
public class LPropBean {
private String loadedProp;
public LPropBean(String loadedProp) {
this.loadedProp = loadedProp;
}
// getters and setters...
}
I updated my XML file:
${loaded-prop}
And updated all of the @Component
s that autowire in the bean:
@Autowire
private LPropBean lPropBean;
// ... later ...
lPropBean.setLoadedProp(newProp);
// ... later ...
lPropBean.getLoadedProp();
I'm sure there is a more elegant way, but this worked exactly how I needed it to.