gpt4 book ai didi

java - PropertiesConfiguration - 在属性值中使用 "/"

转载 作者:行者123 更新时间:2023-11-29 06:24:19 26 4
gpt4 key购买 nike

我正在使用 PropertiesConfiguration 加载和存储属性值。

如果我在属性值中使用字符“/”,它会被保存为“\/”。你能帮我保存'/'而不是'\/'吗?我在这里遗漏了什么吗?

PropertiesConfiguration databaseProperties;
databaseProperties = new PropertiesConfiguration("Properties.properties");
databaseProperties.setProperty("PropName", "jdbc:sqlserver://");
databaseProperties.save();

保存后我的属性文件的值为

PropName = jdbc:sqlserver:\/\/

谢谢,

最佳答案

我使用 1.10 版本的 commons-configuration 并且工作正常:

<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.10</version>
</dependency>

关于java - PropertiesConfiguration - 在属性值中使用 "/",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5342231/

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