Created
June 15, 2012 04:00
-
-
Save aleung/2934603 to your computer and use it in GitHub Desktop.
Spring bean reference injection definition by external configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xsi:schemaLocation=" | |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" | |
default-autowire="byType"> | |
<context:property-placeholder location="file:bin/leoliang/spring/test1/bean.properties"/> | |
<bean id="fooA" class="leoliang.spring.test1.FooImplA" /> | |
<bean id="fooB" class="leoliang.spring.test1.FooImplB" /> | |
<bean id="bar" class="leoliang.spring.test1.Bar"> | |
<property name="foo" ref="${foo_bean_id}"/> | |
</bean> | |
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We have two beans implementing FooInterface: fooA, fooB | |
foo_bean_id = fooB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment