Springboot配置文件之yaml
2017-07-15 22:05
316 查看
只需将Springboot配置文件之properties
的properties配置文件替换成application.yaml即可。
![](https://oscdn.geek-share.com/Uploads/Images/Content/201707/ebb8325d0881ccc328b792956f118673)
application.yaml 配置文件如下,注意换行按Tab键,冒号之后空格。
浏览器实现效果如下:
的properties配置文件替换成application.yaml即可。
application.yaml 配置文件如下,注意换行按Tab键,冒号之后空格。
#32位随机字符串 study: secret: ${random.value} #int类型的随机数字 number: ${random.int} name: zhenqi-study #属性占位符属性 desc: ${study.name} is application yaml #应用端口 server: port: 8090 #时间格式化 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss #时区设置 time-zone: Asia/Shanghai
浏览器实现效果如下:
相关文章推荐
- springBoot(2):Properties和YAML配置文件
- SpringBoot学习记录3------外部配置文件yml
- YAML配置文件解析器:SnakeYAML
- springboot - 配置文件说明
- springboot系列 | 配置文件
- SpringBoot学习:获取yml和properties配置文件的内容(转载)
- SpringBoot学习——如何设置和读取配置文件中属性
- springboot 文件上传大小配置
- 如何在SpringBoot下读取自定义properties配置文件
- SpringBoot 读取配置文件属性值
- Springboot 之 解决IntelliJ IDEA读取properties配置文件的中文乱码问题
- SpringBoot ——配置文件多环境配置
- springBoot(4)---热部署,配置文件使用
- SpringBoot实践-导入jar包中的配置文件
- (三)SpringBoot之配置文件详解:Properties和YAML
- SpringBoot 读取配置文件及profiles切换配置文件
- SpringBoot学习:获取yml和properties配置文件的内容
- [Golang] 从零开始写Socket Server(4):将运行参数放入配置文件(XML/YAML)
- 使用yaml语言来写配置文件
- Spring Boot 配置文件详解:Properties和YAML