Question

I am trying to put my url in wink resource into the property file I have in spring.

When I am trying to use spring @Value annotation to access that property, I am getting it as null.

Wink says for using property in wink, we need to configure custom property bean referenced here http://wink.apache.org/1.0/html/5.5%20Spring%20Integration.html .

But this again is not working. I think its half information.

I want to use the property defined in properties file

spring.properties

my.server.url=http://xx:xx

In my resource I am using this like

myResource.java

@Value("${my.server.url}")
private String myServerUrl;

Getting myServerUrl as null.

Was it helpful?

Solution

Take Care of 2 things

  1. Your spring bean xml file and wink context xml should be in same contextconfigLocation

  2. Do not register your classes in Registrar bean setter.

You will be able to access properties from spring properties fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top