Class WebXmlParser

java.lang.Object
org.apache.tomcat.util.descriptor.web.WebXmlParser

public class WebXmlParser extends Object
Parser for web.xml and web-fragment.xml deployment descriptors.
  • Constructor Details

    • WebXmlParser

      public WebXmlParser(boolean namespaceAware, boolean validation, boolean blockExternal)
      Constructs a new WebXmlParser.
      Parameters:
      namespaceAware - Whether the parser is namespace aware
      validation - Whether validation is enabled
      blockExternal - Whether external entities are blocked
  • Method Details

    • parseWebXml

      public boolean parseWebXml(URL url, WebXml dest, boolean fragment) throws IOException
      Parse a web descriptor at a location.
      Parameters:
      url - the location; if null no load will be attempted
      dest - the instance to be populated by the parse operation
      fragment - indicate if the descriptor is a web-app or web-fragment
      Returns:
      true if the descriptor was successfully parsed
      Throws:
      IOException - if there was a problem reading from the URL
    • parseWebXml

      public boolean parseWebXml(InputSource source, WebXml dest, boolean fragment)
      Parses a web descriptor from an InputSource.
      Parameters:
      source - The input source
      dest - The WebXml instance to populate
      fragment - Whether this is a web-fragment
      Returns:
      true if parsing was successful
    • setClassLoader

      public void setClassLoader(ClassLoader classLoader)
      Sets the ClassLoader to be used for creating descriptor objects.
      Parameters:
      classLoader - the ClassLoader to be used for creating descriptor objects