In Spring, you can get a reference to a BeanFactory using the following syntax:
<constructor-arg ref="&beanFactory" />
This is necessary because if you reference the beanFactory without the & you will simply get an instance of a bean that the factory produces.
In Spring, you can get a reference to a Bean Property using the following syntax:
<constructor-arg ref="bean.propertyName" />
Now what I need to do is to combine these tactics to get a bean property from a beanFactory. I have tried the following syntax with no success:
<constructor-arg ref="&beanFactory.propertyName" />
The above syntax does not work because Spring attempts to reference a bean with the name beanFactory.propertyName
Aucun commentaire:
Enregistrer un commentaire