vendredi 27 février 2015

Spring get BeanFactory property

In Spring, you can get a reference to a BeanFactory using the following syntax:



<constructor-arg ref="&amp;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="&amp;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