Skip to content

Commit 4e31ea8

Browse files
authored
Update 16. Auto-configuration.md
1 parent 987b4c4 commit 4e31ea8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### 16. 自动配置
22

3-
Spring Boot自动配置(auto-configuration)尝试根据你添加的jar依赖自动配置你的Spring应用。例如,如果你的classpath下存在`HSQLDB`并且你没有手动配置任何数据库连接beans,那么我们将自动配置一个内存型(in-memory)数据库。
3+
Spring Boot自动配置(auto-configuration)尝试根据添加的jar依赖自动配置你的Spring应用。例如,如果classpath下存在`HSQLDB`并且你没有手动配置任何数据库连接的beans,那么Spring Boot将自动配置一个内存型(in-memory)数据库。
44

5-
你可以通过将`@EnableAutoConfiguration``@SpringBootApplication`注解添加到一个`@Configuration`类上来选择自动配置
5+
实现自动配置有两种可选方式,分别是将`@EnableAutoConfiguration``@SpringBootApplication`注解到`@Configuration`类上
66

7-
****你只需要添加一个`@EnableAutoConfiguration`注解。我们建议你将它添加到主`@Configuration`类上
7+
****你应该只添加一个`@EnableAutoConfiguration`注解,通常建议将它添加到主配置类(`@Configuration`)上

0 commit comments

Comments
 (0)