Spring boot externalize config properties/messages on Java annotations

后端 未结 4 478
借酒劲吻你
借酒劲吻你 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:21

    You can use a placeholder when you declare a bean in your configuration file.Here you can try an example : https://www.mkyong.com/spring/spring-propertyplaceholderconfigurer-example/

提交回复
热议问题