我對Spring相當陌生,我需要一個有兩個屬性的bean--第二個是引用第一個屬性的內聯bean。類似這樣的:配置Spring Bean重新使用它自己的屬性?
<bean id="aBean" class="com.sample.Bean">
<property name="propertyOne" value="something" />
<property name="propertyTwo">
<bean class="com.sample.AnotherBean">
<property name="propertyThree" ref="propertyOne />
</bean>
</property>
</bean>
製作propertyOne
它自己的bean不是這裏的選項。什麼是實現這一目標的最佳方式?謝謝!
這是我如何解決該問題得到。我希望Spring提供了一個更優雅的解決方案,但是,如果我正在開發的應用程序的性能比Spring好一半,那麼我首先不會遇到這個問題。 – Michael