一、别名

  1. <bean id="userT" class="com.yafnds.pojo.UserT" name="userT2 u2,u3;u4">
  2. <property name="name" value="张三"/>
  3. </bean>
  1. 可以一次取多个别名
  2. 别名之间可以用空格、逗号、分号隔开

    二、导入其他配置文件

当有多个配置文件时,可以将其导入到一个总的配置文件中,常用于多人开发

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans
  5. https://www.springframework.org/schema/beans/spring-beans.xsd">
  6. <!-- 可以将多个配置文件合为一个,即在总的配置文件中能直接使用其他配置文件的内容 -->
  7. <import resource="beans.xml"/>
  8. <import resource="beans2.xml"/>
  9. </beans>

注:导入后只需指定,总的配置文件即可使用其他子配置文件的内容

三、效果图

image.png