SpringBoot 配置文件的识别

作者: gu_lao_rou-p 分类: springBoot 发布时间: 2022-01-04 11:55

SpringBoot会自动识别下面这组配置文件


application.properties/yml


config/application.properties/yml


如果是SpringCloud,还会自动识别下面这组配置文件:


bootstrap.properties/yml


config/bootstrap.properties/yml

用@Value来读自定义配置项

@Value带默认值写法

properties和yml文件互转:https://www.toyaml.com/index.html


Warning: Undefined variable $aria_req in /www/wwwroot/l.lvovl.cn/wp-content/themes/JieStyle-Two-master/comments.php on line 26

Warning: Undefined variable $aria_req in /www/wwwroot/l.lvovl.cn/wp-content/themes/JieStyle-Two-master/comments.php on line 27

Warning: Undefined variable $aria_req in /www/wwwroot/l.lvovl.cn/wp-content/themes/JieStyle-Two-master/comments.php on line 28
标签云