How to control order of bean init-method invocation in Spring?

后端 未结 3 1243
夕颜
夕颜 2021-01-12 01:40

Suppose I have bean, which init-method or constructor should be called after init-method of another bean. Is it possible?

3条回答
  •  情话喂你
    2021-01-12 02:33

    You can use de depends-on attribute on your second bean.

    Reference: http://static.springsource.org/spring/docs/1.2.x/reference/beans.html#beans-factory-dependson

提交回复
热议问题