Spring: Using @Qualifier with Property Placeholder

后端 未结 3 2038
温柔的废话
温柔的废话 2020-12-19 02:23

I am trying to use a property placeholder as the attribute for @Qualifier, as follows:

@Autowired
@Qualifier(\"${beanName}\")
private MyBean myBean;
<         


        
3条回答
  •  眼角桃花
    2020-12-19 03:01

    I encountered exactly same issue. Just use Resource

    @Resource(name="${beanName}")
    private MyBean myBean;
    

提交回复
热议问题