spring properties文件相关

spring properties文件相关


1.properties文件放resources目录下
2.spring容器中最多只能定义一个context:property-placeholder。所以引入多个文件要用正则表达式进行,如:
<context:property-placeholder location="classpath:/*.properties" />

3.使用变量方式
topic="${kafkaConfig.device_report}"  //kafkaConfig.properties里的kafkaConfig.device_report



参考原文: http://www.cnblogs.com/brolanda/p/4244801.html

猜你喜欢

转载自huangyongxing310.iteye.com/blog/2327416
今日推荐