<import resource=" "/>的作用:
比如我们想在spring.xml中导入其它xml文件此时就可以用<import resource=" "/>
<context:property-placeholder location=" ">如果我们想在xml文件中导入.properties文件,此时我们就可以用到<context:property-placeholder location=" ">,如果有多个.properties文件可以用逗号隔开,比如:
<context:property-placeholder location="classpath:redis.properties ,classpath:log4j.properties "/>
如果我们想在单元测试中使用导入xml文件,可以这样写
@ContextConfiguration(locations = {"classpath:spring-redis.xml"})加在要测试的类上面