【发布时间】:2011-07-04 10:05:50
【问题描述】:
可以将@Value 注解与 Spring PropertyPlaceholderConfigurer 一起使用吗?
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:location="classpath:application-test.properties" />
<util:properties id="appProperties" location="classpath:application-test.properties" /> 可与 @Value 正确配合,但我想使用 1 种配置方式。现在我让它们都指向同一个属性文件。
【问题讨论】:
-
嗯,我应该在这里发布我的解决方案 (stackoverflow.com/a/41884089/5290465)。
标签: spring dependency-injection annotations spock