Interface initialization method

Three:

Implement the InitializingBean interface

 

<bean id="testBean" class="TestClass" init-method="initialize"/>

 

@PostConstruct

 

The order of beans in the instantiation process is clear at a glance:

Constructor > @PostConstruct > InitializingBean > init-method

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325335674&siteId=291194637
Recommended