Spring读取配置文件
来源:互联网 发布:小米5刷机端口被关闭 编辑:程序博客网 时间:2024/05/22 13:19
Spring的配置:
<!--读取配置文件 --> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <!--<value>resources/router</value>--> <value>mini_adapter</value> </list> </property> </bean>
@Component("PropertyReader")
public class PropertyReader {
@Resource
private MessageSource messageSource;
public String getValue(String key) {
return getValue(key, null);
}
public String getValue(String code, String message, Object... argument) {
return messageSource.getMessage(code, argument, message, Locale.getDefault());
}
}
0 0
- 读取Spring配置文件
- dom4j读取spring配置文件
- Spring配置文件读取方式
- spring 读取properties配置文件
- Spring读取配置文件
- Spring读取配置文件路径
- spring读取配置文件
- spring resourceLoader 读取配置文件
- spring读取配置文件优化
- Spring读取配置文件
- Spring boot读取配置文件
- Spring读取properties配置文件
- spring 读取自定义配置文件
- spring test读取配置文件
- spring读取配置文件
- spring-boot 配置文件读取
- 读取Spring配置文件
- Spring读取配置文件
- [模板]spfa+邻接表
- 深入理解C++11 第二章兼容性稳定性 学习笔记
- iOS 断点调试小技巧
- Letter Combinations of a Phone Number
- 计算机基础二之计算机文化与计算机思维基础
- Spring读取配置文件
- 2016-8-19 封装一套基础框架,方便开发Spring+SpringMVC+MyBatis+BootStarp
- @RequestMapping 参数详解
- Android使用Gradle命令动态传参完成打包,不需要修改代码
- 微信开发功能
- TCP/IP四层模型
- C++ 数据处理(二)---进制、数据类型
- 决策树原理图表详解
- poj 1459