1

I have application.properties file. I load this file using

@PropertySource("classpath:application.properties")

and now I want to inject a property it to annotation value, in my case

@CrossOrigin(origins = "")

I've tried following without success.

"#{${cors.origins}}"

Note: cors.origins is field I want to inject.

Jaqen K'uba
  • 279
  • 1
  • 3
  • 17
  • Duplicate. Take a look at this post http://stackoverflow.com/questions/21259302/cant-pull-values-from-properties-file-using-annotations – Ricardo Vila Feb 24 '16 at 09:08
  • Standard @Value annotation works just fine. There is no problem with loading specified property, but rather with injecting it into annotation itself. – Jaqen K'uba Feb 24 '16 at 09:10
  • http://stackoverflow.com/questions/14268981/modify-a-class-definitions-annotation-string-parameter-at-runtime/14276270#14276270 – Tobb Feb 24 '16 at 09:47

0 Answers0