在spring中加入以下配置
<import resource="importXmlFile.xml" />
importXmlFile.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="helloService2" class="com.hl.test.service.impl.HelloServiceImpl" />
</beans>
配置好后就可以获取helloService2 bean了
作用
可以将各种类型不同配置文件分开,方便维护