模拟容器的时候,想获取文件路径,结果最后运行的时候却报错了,然后我输出了一下文件路径(inputStream),结果为null,这是为什么
1条回答 默认 最新
- 皮蛋不吃粥 2022-05-20 17:02关注
用类加载器
MyClassPathXmlApplicationContext.class.getClassLoader().getResourceAsStream("")本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 1无用
模拟容器的时候,想获取文件路径,结果最后运行的时候却报错了,然后我输出了一下文件路径(inputStream),结果为null,这是为什么
用类加载器
MyClassPathXmlApplicationContext.class.getClassLoader().getResourceAsStream("")