How to wire Interdependent beans in Spring?

前端 未结 4 2101
既然无缘
既然无缘 2020-12-15 06:40

I want to declare two beans and instantiate them using Spring dependency injection?


 

        
4条回答
  •  粉色の甜心
    2020-12-15 07:32

    You can implement a BeanPostProcessor that sets the dependency.

    Or...

    See Costin's reply here:

    http://forum.springframework.org/showthread.php?t=19569&highlight=circular+dependencies

    See Andreas' reply here:

    http://forum.springframework.org/showthread.php?t=29572&highlight=circular+dependencies

提交回复
热议问题