美文网首页
读取classpath下的.properties文件

读取classpath下的.properties文件

作者: 弱弱的弱 | 来源:发表于2017-11-28 13:59 被阅读0次

spring框架下:
1.使用@Value注解读取.properties文件的属性内容。

2.使用org.springframework.core.io.support.PropertiesLoaderUtils读取.

Properties properties = PropertiesLoaderUtils.loadAllProperties("redis-env.properties");

String deviceToken = properties.getProperty("deviceToken.table.name");

String effectTable = properties.getProperty("userEffectList.table.name");

相关文章

网友评论

      本文标题:读取classpath下的.properties文件

      本文链接:https://www.haomeiwen.com/subject/ymosbxtx.html