-
Notifications
You must be signed in to change notification settings - Fork 38.5k
@Value cannot be used as aliased meta-annotation [SPR-13603] #18181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Juergen Hoeller commented I'm afraid you're running into a limitation of our name-based attribute overriding here: You can't override That said, as of Spring Framework 4.2, you can declare an explicit Juergen |
Jose Antonio Iñigo commented Hi Juergen, first of all, thank you for your quick anwer. I tried
The value of the fields that use Now removing
Maybe I didn't understand well how to use |
Juergen Hoeller commented Checking the lookup algorithm there, we do not evaluate Juergen |
Juergen Hoeller commented This revision is in master now, allowing for Juergen |
Sam Brannen commented Thanks, Juergen Hoeller!
|
Jose Antonio Iñigo commented
|
Jose Antonio Iñigo opened SPR-13603 and commented
It would be nice to be able to use
@Value
as meta annotation:Having a properties file and the necessary context:properties-placeholder configuration...
In a Spring bean we could have:
Where someProperty's value would be "somevalue".
I want to create a new annotation
@Refreshable
with@Value
as meta-annotation so that it behaves the same as using@Value
directly. Since@Value
requires a value I hardcode "default" hoping that@Refreshable
's value() will override it:Then when I use the new annotation in a bean, I was expecting it to work properly, injecting the declared value "somevalue", but it doesn't, I get "default".
Reference URL: http://stackoverflow.com/questions/32964391/annotation-with-spring-value-meta-annotation-not-injecting-the-value
Issue Links:
@AliasFor
attribute name should default to declaring attribute@AliasFor
for@JmsListener
attributesReferenced from: commits 4f95593
The text was updated successfully, but these errors were encountered: