Spring Boot application.properties value not populating

后端 未结 8 553
孤街浪徒
孤街浪徒 2020-12-04 11:41

I have a very simple Spring Boot app that I\'m trying to get working with some externalised configuration. I\'ve tried to follow the information on the spring boot documenta

8条回答
  •  借酒劲吻你
    2020-12-04 12:16

    You can use Environment Class to get data :

    @Autowired
    private Environment env;
    String prop= env.getProperty('some.prop');
    

提交回复
热议问题