一、别名
<bean id="userT" class="com.yafnds.pojo.UserT" name="userT2 u2,u3;u4">
<property name="name" value="张三"/>
</bean>
当有多个配置文件时,可以将其导入到一个总的配置文件中,常用于多人开发
<?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
https://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- 可以将多个配置文件合为一个,即在总的配置文件中能直接使用其他配置文件的内容 -->
<import resource="beans.xml"/>
<import resource="beans2.xml"/>
</beans>
注:导入后只需指定,总的配置文件即可使用其他子配置文件的内容