英文:
How can i change properties in application.properties?
问题
有人能否提供任何方法,以便在应用程序启动时更改application.properties中的属性?在应用程序启动时,我可以从数据库中接收一些属性,这些属性应该覆盖文件中相应的属性。我的目标是在应用程序启动时只更改它们一次... 我该如何实现这一点?
英文:
Could anyone advice any way how the properties in application.properties can be changed on application startup? On application start i can receive some propertied from DB that should override my appropriate properties at file. My goal is tho change them only once on app start...
How can i achieve this?
答案1
得分: 0
为什么不为这个程序创建一个启动器?启动器将负责定位和使用适当的属性。因此,当启动器程序启动时,您将通过数据库连接检查新属性,将属性安装在适当的位置,然后启动您的真实程序。
英文:
Why don't you create a launcher for the program ? It will be the launcher responsibility to locate and use appropriate properties ? So when the launcher program starts you will check via DB connection for new properties install the properties on the appropriate location and then launch your real program.
专注分享java语言的经验与见解,让所有开发者获益!
评论