gpt4 book ai didi

spring-boot - 如何为 Spring Boot 的 application.properties 中存在的属性设置值

转载 作者:太空宇宙 更新时间:2023-11-03 14:31:33 25 4
gpt4 key购买 nike

我为我的 spring boot 应用程序启用了 ssl。我正在通过我的应用程序中的一个类从 AWS Secrets Manager 获取 keystore 密码。如何在我的 application.properties 中引用此密码?

最佳答案

获取属性值后,可以在环境中进行如下设置:

String password = getPasswordFromKeyStore();
environment.setProperty("password", password);

因此它将被分配给 application.properties 文件中定义的属性。

关于spring-boot - 如何为 Spring Boot 的 application.properties 中存在的属性设置值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52404803/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com