SpringBoot核心配置文件是什么?

原文:https://blog.csdn.net/meism5/article/details/90446816

问: SpringBoot的核心配置文件是什么?

答:SpringBoot的核心配置文件有俩种类型,一种是**.properties格式,一种是***.yml格式。  

(1) .properties 文件 和 .yml格式有什么区别?

.properties 文件中的内容是key=value的格式。举个栗子,  server.port=8006

.yml文件中的内容是 key:value格式。  举个栗子。

(2). *.yml加载的属性是有顺序的,但不支持@PropertySource注解来导入配置,一般推荐用yml文件,看下来更加形象。 

(3) Spring框架的系列教程:

      https://mp.weixin.qq.com/s/N507Cfb_mbkGvHtg_FIaVg 

发布了46 篇原创文章 · 获赞 42 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/tangthh123/article/details/104144115