I'm beginner in spring boot and I tried to use @ConfigurationProperties or @PropertySource but I always get a null value
my application.properties file :
#application.properties
db.url:https://host.madb
my class :
@ConfigurationProperties( locations="classpath:/main/resources/application.properties", prefix = "db")
public class TorSeviceImpl {
//if I use @PropertySource("classpath:/main/resources/application.properties") I ll add : @Value("${db.url}")
private String url;
but my url variable is always null
Thanks for your help
@Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); }
– Zaoueche Nov 06 '14 at 15:00