[springboot] Spring bean class initialization listener

insert image description here

The previous section introduced the initialization action when the application service starts. In fact, some initialization actions are not necessarily performed when the application service is started, because at this time initialization, often some Spring Beans have not yet constructed objects, and some properties attribute values ​​have not been injected yet, resulting in some necessary conditions for our initialization actions. Ready, the so-called initialization action can not be carried out correctly.

Therefore, some initialization actions that we often use can also be performed when the bean is initialized, as follows:

import org.springframework.beans.factory.InitializingBean;
import org

Guess you like

Origin blog.csdn.net/hanxiaotongtong/article/details/122892904