I tried to use spring @Value to get property from application.properties file. However, if I do
@Service
public class FooClass {
@Value("${abc}")
private String var;
public String foo() {
System.out.println(var);
}
}
@Configuration
public class ConfigurationReader {
@Bean
public FooClass fooClass()
{
return new FooClass();
}
}
I got "${abc}" assgined to var instead of the value in the property file. Any idea? guys. Thanks in advance.