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; }
You can use @Value:
@Value
@Value("${clientapi.url}") public void setClientApiUrl(String clientApiUrl) { this.clientApiUrl = clientApiUrl; }
1.4m articles
1.4m replys
5 comments
57.0k users