Spring MVC 通过@Value注解读取.properties配置
来源:互联网 发布:退货还给淘宝客佣金吗 编辑:程序博客网 时间:2024/05/16 10:26
第一步:application.properties配置文件中建立内容:
ios.test.appKey=824f1694e205e2973933482cios.test.masterSecret=206399b1ce5e75236bcf0490
第二步:配置applicationContext-commom.xml文件:
<bean id="configProperties" class="com.sf.egmas.isn.framework.SystemProperties"> <property name="locations"> <array><value>classpath:application.properties</value> </array></property></bean><bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> <property name="properties" ref="configProperties" /> </bean>第三步:在java代码类读取配置文件的内容:
@Value("#{configProperties['jiguang.hmt.ios.appKey']}") private String hmtIosAppKey; @Value("#{configProperties['jiguang.hmt.ios.masterSecret']}") private String hmtIosMasterSecret;
0 0
- Spring MVC 通过@Value注解读取.properties配置
- Spring MVC 通过@Value注解读取.properties配置
- Spring MVC 通过@Value注解读取.properties配置
- Spring MVC 通过@Value注解读取.properties配置内容
- Spring MVC 通过@Value注解读取.properties配置内容
- Spring MVC 通过@Value注解读取.properties配置
- Spring MVC 通过@Value注解读取.properties配置结果为null
- 通过@Value注解读取.properties配置内容
- 通过@Value注解读取.properties配置内容
- 通过@Value注解读取.properties配置内容
- SpringMVC通过@Value注解读取.properties配置
- 通过@Value注解读取.properties配置内容
- SpringMVC通过@Value注解读取.properties配置
- 通过@Value注解读取.properties配置内容
- 通过@Value注解读取.properties配置内容
- 通过@Value注解读取.properties配置内容
- Spring通过注解@Value获取properties配置
- 通过@Value注解读取.properties配置内容 (续)
- Ubuntu安装镜像
- CSS自动换行、强制不换行、强制断行、超出显示省略号
- jQuery.offsetParent() 函数详解
- 就是那个在公司女同事之间风评也差到爆的秃驴。
- 从此不求人:自主研发一套PHP前端开发框架(27)
- Spring MVC 通过@Value注解读取.properties配置
- git配置
- Python学习-机器学习实战-ch06 支持向量机
- Android* 操作系统上的应用程序远程调试
- C++ 语言宏定义函数的使用(定义单行和多行)
- 知名ssl公司有哪些?
- Tricks(四十二)—— 数据集分块
- 断言assert,和#define NDBUG 学习小结
- NTFS For Mac设置说明