I would really like to annotate a method with a reference to one property in the properties file for injection.
@Resource("${my.service.url}") private String myServiceUrl;
Of course, this syntax does not work;) That's why I ask here.
I know that I can insert the full properties file, but it just seems excessive, I don't want the properties file - I need a configured value.
Edit: I can only see examples of PropertyPlaceholderConfigurer, where XML is used to bind properties to this field. I still can’t understand how this can be achieved using annotations?
java spring
krosenvold
source share