Spring Boot面试题总结如何优化为长尾关键词?
- 内容介绍
- 文章标签
- 相关推荐
本文共计779个文字,预计阅读时间需要4分钟。
1. Spring Boot的配置文件格式:application.properties或application.yml,它们的主要区别在于书写格式不同。
2.properties格式示例:springboot.user.name=testname
3.yml格式示例:springboot: user: name: testname
1 Spring Boot的配置文件格式
application.properties或者是application.yml,它们的区别主要是书写格式不同。
1).properties:
springboot.user.name = testname
2).yml:
springboot: user: name: testname
另外,.properties格式文件的属性是无序的,.yml 格式文件的属性是有序的,但它不支持@PropertySource注解导入配置。
2 Spring Boot的核心注解
启动类上面的注解是@SpringBootApplication,它也是Spring Boot的核心注解,主要组合包含了以下3个注解:
@SpringBootConfiguration:组合了 @Configuration 注解,实现配置文件的功能。
本文共计779个文字,预计阅读时间需要4分钟。
1. Spring Boot的配置文件格式:application.properties或application.yml,它们的主要区别在于书写格式不同。
2.properties格式示例:springboot.user.name=testname
3.yml格式示例:springboot: user: name: testname
1 Spring Boot的配置文件格式
application.properties或者是application.yml,它们的区别主要是书写格式不同。
1).properties:
springboot.user.name = testname
2).yml:
springboot: user: name: testname
另外,.properties格式文件的属性是无序的,.yml 格式文件的属性是有序的,但它不支持@PropertySource注解导入配置。
2 Spring Boot的核心注解
启动类上面的注解是@SpringBootApplication,它也是Spring Boot的核心注解,主要组合包含了以下3个注解:
@SpringBootConfiguration:组合了 @Configuration 注解,实现配置文件的功能。

