How to correct inject map of bean in spring context

前端 未结 2 360
青春惊慌失措
青春惊慌失措 2020-12-20 14:36

I am using component-scan in my spring application. So in spring context I created map:



        
2条回答
  •  无人及你
    2020-12-20 15:08

    Quote from the documentation:

    An autowired Maps values will consist of all bean instances that match the expected type, and the Maps keys will contain the corresponding bean names.

    I think that just changing @Inject with @Resource will do it.

提交回复
热议问题