我有我的applicationContext.xml春属性(属性占位符)自动装配
<context:property-placeholder location="classpath*:*.properties" />
<bean id="clientPreferencesManager" class="pl.bildpresse.bildchat2.business.ClientPreferencesManager" >
<property name="clientApiUrl" value="${clientapi.url}" />
</bean>
是否有可能通过自动装配这样做?喜欢的东西:
@Autowired
@Qualifier("${clientapi.url}")
public void setClientApiUrl(String clientApiUrl) {
this.clientApiUrl = clientApiUrl;
}
true,对于当前版本的spring 3.0。 (+1) – Bozho 2010-05-21 16:48:45
所以这是美元符号!不是散列。谢谢你的提示。 @Value的javadocs误导了我 – 2012-03-30 20:30:00
愚蠢的问题,但它从哪里得到$ {clientapi.url}? – user2441441 2016-06-14 22:24:07