Following best practices, I\'m using Thread.currentThread().getContextClassLoader().getResourceAsStream to load resources in a web application (like text files or x
Thread.currentThread().getContextClassLoader().getResourceAsStream
Try this:
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader(); URL resURL = ctxLoader.getResource(resName); URLConnection resConn = resURL.openConnection(); resConn.setUseCaches(false); InputStream resIn = resConn.getInputStream(); ...