Spring boot externalize config properties/messages on Java annotations

后端 未结 4 467
借酒劲吻你
借酒劲吻你 2021-01-04 12:37

Is there a way to read text from external properties file in spring without using the @Value annotation. Ex: application.properties

var.foo=\"he         


        
4条回答
  •  醉梦人生
    2021-01-04 13:27

    If you are using Spring Boot then you can try this method, without doing any special configuration

    @environment.getProperty('property')
    

提交回复
热议问题