spring autowiring not working from a non-spring managed class

前端 未结 10 909
暗喜
暗喜 2020-12-03 06:43

I have a class (Class ABC) that\'s instantiated by calling the constructor. Class ABC in turn has a helper class (Class XYZ) injected using auto-wired.

Ours is a Sp

10条回答
  •  死守一世寂寞
    2020-12-03 07:47

    You can annotate ABC class with @Configurable annotation. Then Spring IOC will inject XYZ instance to ABC class. It's typically used with the AspectJ AnnotationBeanConfigurerAspect.

提交回复
热议问题