1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-07-28 12:22:17 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Guide
34abfa7d2b
Merge pull request #1728 from yellowgg/patch-1
补充相关注解
2022-05-15 11:24:49 +08:00
yellowgg
0b29f8aed0
补充相关注解
补充相关注解
2022-05-14 22:59:48 +08:00

View File

@ -61,7 +61,7 @@ public @interface SpringBootConfiguration {
根据 SpringBoot 官网,这三个注解的作用分别是:
- `@EnableAutoConfiguration`:启用 SpringBoot 的自动配置机制
- `@ComponentScan` 扫描被`@Component` (`@Service`,`@Controller`)注解的 bean注解默认会扫描该类所在的包下所有的类。
- `@ComponentScan` 扫描被`@Component` (`@Repository`,`@Service`,`@Controller`)注解的 bean注解默认会扫描该类所在的包下所有的类。
- `@Configuration`:允许在 Spring 上下文中注册额外的 bean 或导入其他配置类
### 2. Spring Bean 相关