srpingboot的核心配置文件只有一个
但是形式可以有三种
- .properties
- .yml
- .yaml
以下例子以端口和上下根的设置为例
properties的格式
application.properties
server.port=8081
server.servlet.context-path=/springboot
yml格式
application.yml
server:
port: 8081
servlet:
context-path: /springboot
yaml格式
application.yaml 格式和yml一样
server:
port: 8081
servlet:
context-path: /springboot
如果同时存在
如果同时存在,properties优先级高
---------------------------------
其他springboot相关知识看专栏其他内容
635




被折叠的 条评论
为什么被折叠?



