Spring properties (property-placeholder) autowiring

Posted by peperg on Stack Overflow See other posts from Stack Overflow or by peperg
Published on 2010-05-21T13:43:37Z Indexed on 2010/05/21 14:30 UTC
Read the original article Hit count: 296

I have in my applicationContext.xml

<context:property-placeholder location="classpath*:*.properties" />


<bean id="clientPreferencesManager" class="pl.bildpresse.bildchat2.business.ClientPreferencesManager" >
    <property name="clientApiUrl" value="${clientapi.url}" />     
</bean>

Is it possible to do the same by autowire ? Something like :

@Autowired
@Qualifier("${clientapi.url}")
public void setClientApiUrl(String clientApiUrl) {
    this.clientApiUrl = clientApiUrl;
}

© Stack Overflow or respective owner

Related posts about spring

Related posts about spring-framework