Spring分配置文件开发
在一个项目中如果有太多的Spring xml文件,我们可以进行整合管理
模式1:
构造时传入每个配置文件
Spring 配置文件
demo.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean name="bean2" class="com.example.Bean2"></bean>
<bean name="bean1" class="com.example.Bean1">
<property name="num" value="#{T(java.lang.Math).random()}"></property>
<property name="map" value="#{ {'dsd':'gsdf'}}"></property>
<property name=