BlessingCR’s Blog
BlessingCR’s Blog

自动配置

Spring Boot 自动配置--Auto-Configuration

  1. 基于引入的Jar包,对Spring Boot进行自动配置
  1. 为Spring Boot的《开箱即用》提供基础支撑

自动配置Auto-Configuration和自动装配Autowire是不同的概念

配置类 Configuration Class

广义的配置类: 被@Component 直接或间接袖子的内, 即我们说的Spring 组件,包括了@Configuration类

狭义的配置类, 特指@Configuration 修饰的某个类

举例

https://vipkshttps13.wiz.cn/editor/d43a29e0-2b90-11ed-a050-f704bb07f03a/a94870e5-8f1a-4545-bcf8-5a5df9342a82/resources/8mLDaxpM8bSuZQ7yC0MafJw2Y_z8OCjZuu7WZyUqhZ4.png?token=W.FVORyDEtE7ytUBzmZPgrW2uRyVhWY2RvOxgAG8Q8PN2qT38yddLdGijCeWXus5w

除了引入,写yml,就可以直接用

发表回复

textsms
account_circle
email

  • Excellent read, I just passed this onto a colleague who was doing a little research on that. And he just bought me lunch as I found it for him smile So let me rephrase that: Thanks for lunch!

    1 月前 回复

BlessingCR’s Blog

自动配置
Spring Boot 自动配置--Auto-Configuration 基于引入的Jar包,对Spring Boot进行自动配置 为Spring Boot的《开箱即用》提供基础支撑 自动配置Auto-Configuration和自动装配A…
扫描二维码继续阅读
2023-02-21