@Value not resolved when using @PropertySource annotation. How to configure PropertySourcesPlaceholderConfigurer?

前端 未结 11 1183
情深已故
情深已故 2020-11-28 23:11

I have following configuration class:

@Configuration
@PropertySource(name = \"props\", value = \"classpath:/app-config.properties\")
@ComponentScan(\"service         


        
11条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 23:57

    Another thing that may be happening: ensure your @Value annotated values are not static.

提交回复
热议问题