Skip to content

Commit 438b610

Browse files
committed
✨ Introducing new features.Spring lifecycle
1 parent 76de081 commit 438b610

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MD/spring/spring-bean-lifecycle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Spring Bean 的生命周期在整个 Spring 中占有很重要的位置,掌握
1515

1616
### 注解方式
1717

18-
在 bean 初始化时会经历几个阶段,首先可以使用注解 `@PostConstruct`, `@PreDestroy` 来再 bean 的创建和销毁阶段进行调用:
18+
在 bean 初始化时会经历几个阶段,首先可以使用注解 `@PostConstruct`, `@PreDestroy` 来在 bean 的创建和销毁阶段进行调用:
1919

2020
```java
2121
@Component
@@ -87,7 +87,7 @@ public class SpringLifeCycle{
8787

8888
以上是在 SpringBoot 中可以这样配置,如果是原始的基于 XML 也是可以使用:
8989

90-
```
90+
```xml
9191
<bean class="com.crossoverjie.spring.SpringLifeCycle" init-method="start" destroy-method="destroy">
9292
</bean>
9393
```

0 commit comments

Comments
 (0)