本文共 340 字,大约阅读时间需要 1 分钟。
<import resource=" "/>的作用:
比如我们想在spring.xml中导入其它xml文件此时就可以用<import resource=" "/>
<context:property-placeholder location=" ">如果我们想在xml文件中导入.properties文件,此时我们就可以用到<context:property-placeholder location=" ">,如果有多个.properties文件可以用逗号隔开,比如:
如果我们想在单元测试中使用导入xml文件,可以这样写
@ContextConfiguration(locations = {"classpath:spring-redis.xml"})加在要测试的类上面
转载地址:http://ydqen.baihongyu.com/