gpt4 book ai didi

spring - <上下文 :property-placeholder loading from the filesystem

转载 作者:行者123 更新时间:2023-12-04 06:55:32 25 4
gpt4 key购买 nike

<context:property-placeholder ignore-unresolvable="true" location="classpath:test.properties" />

上面提到的从 contex:property-placeholder 加载属性文件的方法工作得很好。我想做的是从文件系统加载属性文件。

假设我在 C 驱动器 C:\spring\test.properties 中有文件。此处如何使用 context:property-placeholder 加载文件。

最佳答案

使用 file: URL 而不是 classpath: 一个

<context:property-placeholder ignore-unresolvable="true"
location="file:/C:/spring/test.properties" />

关于spring - <上下文 :property-placeholder loading from the filesystem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17303261/

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