springboot 自定义配置文件
来源:互联网 发布:linux sosreport 编辑:程序博客网 时间:2024/06/04 23:36
除了application.yml ,自定义另外的配置文件,如何读取。
bus.yml:
email: xxxx@163.comscheduleEnable: true
定义配置文件读取类:
/** bus.yml 参数读取 * @author xz * */@Component@PropertySource("classpath:bus.yml")@ConfigurationPropertiespublic class BusinessConfig { private String email; private boolean scheduleEnable; public boolean isScheduleEnable() { return scheduleEnable; } public void setScheduleEnable(boolean scheduleEnable) { this.scheduleEnable = scheduleEnable; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; }}
使用:
@Autowired BusinessConfig busConfig; // 正常使用
阅读全文
0 0
- springboot读取自定义配置文件
- springboot自定义配置文件
- springboot使用自定义配置文件
- SpringBoot 读取自定义配置文件
- springboot 自定义配置文件
- Springboot 之 自定义配置文件及读取配置文件
- Springboot 之 自定义配置文件及读取配置文件
- Springboot 之 自定义配置文件及读取配置文件
- Springboot 之 自定义配置文件及读取配置文件
- Springboot 之 自定义配置文件及读取配置文件
- Springboot 之 自定义配置文件及读取配置文件
- SpringBoot之配置文件及自定义参数
- springboot 1.5.2 自定义的配置文件加载
- SpringBoot自定义配置文件fatjar获取不到解决办法
- 4.Springboot 之 自定义配置文件及读取配置文件
- springboot 配置文件
- SpringBoot 配置文件
- SpringBoot---配置文件
- C++中函数重载、隐藏、覆盖和重写的区别 转自:http://www.bijishequ.com/detail/277975?p=
- CentOS 7安装OpenCV和YOLO
- thymeleaf js中获取后台传到界面的值
- 绝对路径和相对路径
- html学习笔记二
- springboot 自定义配置文件
- 简单的EXCLE表格上传服务器,在通过mybatis 导入到数据库中
- 查看某个class是从那个jar包中load进来的,避免不同jar包打架的情况
- 说说JSON和JSONP,也许你会豁然开朗,含jQuery用例
- 安卓小项目之EveryDay(6)----使用第三方平台获取短信验证码
- apach更改域名解析
- 7个经典创意jQuery应用插件及源码
- Java计算平均日期
- spring-拦截器