Spring beans config - import order, can we use ref value of bean which is configured later in xml by import? -
i have following spring beans config:
<import resource="a1.xml"/> <import resource="a2.xml"/> <import resource="a3.xml"/>
can use ref link bean a3.xml in a1.xml?
for example in a1.xml:
<bean id="someid" class="com.xxxx.yyyy" scope="prototype"> <property name="test" ref="%some_bean_id_from_a3.xml%"/> </bean>
is valid?
yes, can. following setup work:
appconf.xml
<bean id="urlpath" class="java.lang.string"> <constructor-arg type="char[]" value="google.com"/> </bean>
appconf2.xml
<import resource="appconf.xml"/> <bean id="urlbean" class="java.net.url"> <constructor-arg ref="urlpath"/> </bean>
Comments
Post a Comment