心理

當前位置 /首頁/完美生活/心理/列表

springboot注入初始化方法

springboot注入初始化方法

用的三種指定特定操作的方法: 通過實現InitializingBean/DisposableBean 接口來定製初始化之後/銷燬之前的操作方法

通過<bean> 元素的 init-method/destroy-method屬性指定初始化之後 /銷燬之前調用的操作方法

在指定方法上加上@PostConstruct或@PreDestroy註解來制定該方法是在初始化之後還是銷燬之前調用。

TAG標籤:springboot 初始化 注入 #