Reading values from application.properties Spring Boot

后端 未结 10 1695
无人及你
无人及你 2021-01-18 10:46

My Spring boot app has this application structure:

  • src
    • main
      • java
      • resources
        • application.properties
      <
10条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 11:36

    As provided in the 2nd answer above I was indeed using the spring boot, so removed the static keyword and that resolved my issue. Make sure you don't have static for the property defined with @Value.

提交回复
热议问题