How to autowire bean in same bean

后端 未结 3 976
无人共我
无人共我 2021-01-23 04:52

I would like to autowire instance of bean A to the same instance of A. How can I achieve this with annotation (without XML).

Example:



        
3条回答
  •  日久生厌
    2021-01-23 05:08

    @Autowired skip the annotated bean when looking for autowire candidates, use @Resource instead.

提交回复
热议问题