我将带有属性的文件放入 *tomcat_folder*/conf 并尝试读取它:
InputStream input = this.getClass().getClassLoader().getResourceAsStream("conf.properties");
properties.load(input);
但实际上我收到'null'。我试图打印出当前文件夹,它显示“home/username”文件夹(我想从当前文件夹进入 conf 文件夹)。
“catalina.properties”包含“shared.loader=”,所以理论上这个文件应该从那里读取,但它不是......
有没有关于如何做到这一点的解决方案?