博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spring中导入配置文件的区别
阅读量:3908 次
发布时间:2019-05-23

本文共 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/

你可能感兴趣的文章
Python collections deque - double-ended queue ()
查看>>
Python sort sorted OrderDict
查看>>
Python dict sort
查看>>
Python lambda
查看>>
Python modify string in place
查看>>
Python dict del
查看>>
Http header
查看>>
HTTP Header
查看>>
ASCII - American Standard Code for Information Interchange
查看>>
进制转换
查看>>
Python L suffix - indicated long integer literals before Python3
查看>>
URL shortner
查看>>
Django short url
查看>>
Tech Blog
查看>>
Logon System Design
查看>>
Python yield
查看>>
Sina API OAuth
查看>>
Python supervisor
查看>>
dict & set
查看>>
Common Multiple and Least Common Multiple(LCM)
查看>>