我们使用环境变量来配置Spring Boot应用程序中的各种属性。我发现在Spring Boot1.4.3.RELEASE/Spring4.3.5.RELEASE中,通过@Value(${foo.bar.baz})
绑定环境变量FOO_BAR_BAZ
是开箱即用的。
所以我的问题是,我是否必须期望观察到的行为(如上所述)随着未来的发布而消失?
1:https://docs.spring.io/spring-boot/docs/1.4.3.RELEASE/reference/htmlsingle/#boot-features-external-config-relaxed-binding,https://docs.spring.io/spring-boot/docs/1.4.3.RELEASE/reference/htmlsingle/#boot-features-external-config-vs-value
发布于 2017-08-08 14:06:31
一些简单的松散绑定似乎可以与@Value一起工作。有关更多信息,请查看以下讨论:https://github.com/spring-projects/spring-boot/issues/4413
https://stackoverflow.com/questions/45568388
复制