Skip to content

Commit 80532d2

Browse files
authored
Update 18. Using the @SpringBootApplication annotation.md
1 parent b22fedc commit 80532d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

III. Using Spring Boot/18. Using the @SpringBootApplication annotation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### 18. 使用@SpringBootApplication注解
22

3-
很多Spring Boot开发者总是使用`@Configuration``@EnableAutoConfiguration``@ComponentScan`注解他们的main类。由于这些注解被如此频繁地一块使用(特别是你遵循以上[最佳实践](14. Structuring your code.md)),Spring Boot提供一个方便的`@SpringBootApplication`选择
3+
很多Spring Boot开发者经常使用`@Configuration``@EnableAutoConfiguration``@ComponentScan`注解他们的main类,由于这些注解如此频繁地一块使用(特别是遵循以上[最佳实践](14. Structuring your code.md)的时候),Spring Boot就提供了一个方便的`@SpringBootApplication`注解作为代替
44

5-
`@SpringBootApplication`注解等价于以默认属性使用`@Configuration``@EnableAutoConfiguration``@ComponentScan`
5+
`@SpringBootApplication`注解等价于以默认属性使用`@Configuration``@EnableAutoConfiguration``@ComponentScan`
66
```java
77
package com.example.myproject;
88

@@ -18,3 +18,4 @@ public class Application {
1818

1919
}
2020
```
21+
**** `@SpringBootApplication`注解也提供了用于自定义`@EnableAutoConfiguration``@ComponentScan`属性的别名(aliases)。

0 commit comments

Comments
 (0)