且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从类路径资源(XML文件)获取输入流

更新时间:2023-11-16 15:51:52

ClassLoader.getResourceAsStream()


In Java web application, Suppose if I want to get the InputStream of an XML file, which is placed in the CLASSPATH (i.e. inside the sources folder), how do I do it?

ClassLoader.getResourceAsStream().