retrieving resources via class loader I first posted my question on the IO forum, but I now realize its more of a app server question.

Steve Pruitt

The following code is from the ActionServlet-class from Struts , method protected void parseModuleConfigFile(Digester digester, String path) that loads /WEB-INF/struts-config.xml: (Variable path contains "/WEB-INF/struts-config.xml"

            URL url = getServletContext().getResource(path);

            // If the config isn't in the servlet context, try the class loader
            // which allows the config files to be stored in a jar
            if (url == null) {
                url = getClass().getResource(path);
            if (url == null) {
                String msg = internal.getMessage("configMissing", path);
                throw new UnavailableException(msg);
            InputSource is = new InputSource(url.toExternalForm());
            input = url.openStream();
You now have an InputSream for the XML-file