问题
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