/** * <p>Parse the web.xml for the current application and scan * for a FacesServlet entry, if found, set the * <code>facesServletPresent</code> property to true. * @param context the ServletContext instance for this application */ private void scanForFacesServlet(ServletContext context) { SAXParserFactory factory = getConfiguredFactory(); try { SAXParser parser = factory.newSAXParser(); parser.parse(context.getResourceAsStream(WEB_XML_PATH), new WebXmlHandler()); } catch (Exception e) { // This probably won't happen since the container would // catch it before we would, but, if we catch an exception // processing the web.xml, set facesServletFound to true to // default to our previous behavior of processing the faces // configuration. if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, MessageFormat.format("Unable to process deployment descriptor for context ''{0}''", getServletContextIdentifier(context))); } facesServletPresent = true; } } // END scanForFacesServlet
try { SAXParser parser = factory.newSAXParser(); parser.parse(in, new WebXmlHandler()); } catch (ParserConfigurationException | SAXException | IOException e) { warnProcessingError(e, context); fragmentStream = conn.getInputStream(); SAXParser parser = factory.newSAXParser(); parser.parse(fragmentStream, new WebXmlHandler()); } catch (IOException | ParserConfigurationException | SAXException e) { warnProcessingError(e, context);
try { SAXParser parser = factory.newSAXParser(); parser.parse(in, new WebXmlHandler()); } catch (ParserConfigurationException | SAXException | IOException e) { warnProcessingError(e, context); fragmentStream = conn.getInputStream(); SAXParser parser = factory.newSAXParser(); parser.parse(fragmentStream, new WebXmlHandler()); } catch (IOException | ParserConfigurationException | SAXException e) { warnProcessingError(e, context);
try { SAXParser parser = factory.newSAXParser(); parser.parse(in, new WebXmlHandler()); } catch (ParserConfigurationException | SAXException | IOException e) { warnProcessingError(e, context); fragmentStream = conn.getInputStream(); SAXParser parser = factory.newSAXParser(); parser.parse(fragmentStream, new WebXmlHandler()); } catch (IOException | ParserConfigurationException | SAXException e) { warnProcessingError(e, context);
try { SAXParser parser = factory.newSAXParser(); parser.parse(in, new WebXmlHandler()); } catch (Exception e) { warnProcessingError(e, context); fragmentStream = conn.getInputStream(); SAXParser parser = factory.newSAXParser(); parser.parse(fragmentStream, new WebXmlHandler()); } catch (Exception e) { warnProcessingError(e, context);