How to inject properties into a spring bean from Main class

后端 未结 3 1923
被撕碎了的回忆
被撕碎了的回忆 2021-01-23 12:30

I\'m using spring with my application, and I\'m able to inject some properties from some file on a class path into my app and everything works perfectly. i.e.

&         


        
3条回答
  •  忘了有多久
    2021-01-23 13:33

    If I am reading your question correctly, You want to use an external properties file(i.e File is not in the application runtime class path). If that is the case you need to use the file tag

     file:///c:\application.properties
    

提交回复
热议问题