// Obtain a ResourceReader that is compatible with a startup ExternalContext
ResourceReader resourceReader = newResourceReader();
// Obtain a SAX Parser Factory.
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setValidating(false);
saxParserFactory.setNamespaceAware(true);
try {
// Obtain a SAX Parser from the factory.
SAXParser saxParser = saxParserFactory.newSAXParser();
// Scan all the web.xml and web-fragment.xml descriptors in the classpath.
WebConfigScanner webConfigScanner = newWebConfigScanner(classLoader, resourceReader, saxParser,
resolveEntities);
WebConfig webConfig = webConfigScanner.scan();