Why do I need a setter for autowired / injected field?

后端 未结 3 1868
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 00:16

I have a bean:

    
        

        
3条回答
  •  悲哀的现实
    2021-02-06 01:03

    My understanding is that XML configuration overrides annotation config.The fact that autowire="byType" specified overrides the auto injection, which looks for a presence of setter method for injecting the dependency.

提交回复
热议问题