如何在Spring Boot中更改运行时的application.properties文件。

huangapple 未分类评论45阅读模式
英文:

how to change runtime application.properties in spring boot

问题

在Spring Boot应用程序中,我可以使用@ConfigurationProperties注解将application.yml中的属性绑定到bean字段。

是否可能在运行时更新application.yml中的这些属性,并使其在bean中反映出来?如果是,应该如何做到这一点?

英文:

In a spring boot application, I am able to bind properties from application.yml to the bean fields using @ConfigurationProperties annotation.

Is it possible to update these properties in application.yml at runtime and get them reflected in the bean? If yes. How to do this?

huangapple
  • 本文由 发表于 2020年7月23日 13:04:16
  • 转载请务必保留本文链接:https://java.coder-hub.com/63047212.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定