Using a static variable value in Qualifier annotation

妖精的绣舞 提交于 2019-12-13 06:01:58

问题


Is it possible to pass a static variable defined in a class as argument to @Qualifier annotation? I tried the below format and a few other variations, but nothing worked.

@Qualifier("T(com.test.Constants).BEAN_NAME")

Spring-el works in @Value annotation. For example, below example is valid:

@Value("#{ systemProperties['user.region'] }")

回答1:


Try with @Qualifier(com.test.Constants.BEAN_NAME)



来源:https://stackoverflow.com/questions/16472627/using-a-static-variable-value-in-qualifier-annotation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!