Bonjour,
Je debute en Spring Boot et je n arrive pas a recuperer les valeur de application.properties a travers les annotations @ConfigurationProperties ou @PropertySource
Mon fichier se trouve dans /src/main/resources/application.properties et avant ma classe j utlise l annotation @ConfigurationProperties( locations="classpath:/main/resources/application.properties", prefix = "db") ou @PropertySource("classpath:/main/resources/application.properties")
Mais la valeur me retroune toujours null
contenu de mon fichier application.properties
Ma classe
Merci d avance@ConfigurationProperties( locations="classpath:/main/resources/application.properties", prefix = "db")
public class TorSeviceImpl {
//si j utilise @PropertySource("classpath:/main/resources/application.properties") j ajoute : @Value("${db.url}")
private String url;
Partager