7
我正在閱讀liferay源代碼,發現使用相同bean-id的2個xml文件。如果使用這種方式,所有的屬性會合並在一起嗎?在不同的xml文件上有相同的bean id,它會合並嗎?
dynamic-data-spring
----------------------
<bean id="liferayDataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="targetSource" ref="dynamicDataSourceTargetSource" />
</bean>
</property>
</bean>
infrastructure-spring.xml
----------------------
<bean id="liferayDataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<bean class="com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean">
<property name="propertyPrefix" value="jdbc.default." />
</bean>
</property>
</bean>
看看這個春季修復,以避免「尋找日誌文件條目」遊戲:http://jira.springframework.org/browse/SPR-4374 – SteveD 2009-09-18 10:46:50