Class WebXmlParser


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

      Constructors 
      Constructor Description
      WebXmlParser​(boolean namespaceAware, boolean validation, boolean blockExternal)
      Constructs a new WebXmlParser.
      WebXmlParser​(boolean namespaceAware, boolean validation, boolean blockExternal, boolean urlPatternsProvidedInDecodedForm)
      Deprecated.
      This constructor will be removed in Tomcat 12
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean getUrlPatternsProvidedInDecodedForm()
      Deprecated.
      This method will be removed in Tomcat 12 where it will effectively be hard-coded to true
      boolean parseWebXml​(java.net.URL url, WebXml dest, boolean fragment)
      Parse a web descriptor at a location.
      boolean parseWebXml​(org.xml.sax.InputSource source, WebXml dest, boolean fragment)
      Parses a web descriptor from an InputSource.
      void setClassLoader​(java.lang.ClassLoader classLoader)
      Sets the ClassLoader to be used for creating descriptor objects.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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
      • WebXmlParser

        @Deprecated
        public WebXmlParser​(boolean namespaceAware,
                            boolean validation,
                            boolean blockExternal,
                            boolean urlPatternsProvidedInDecodedForm)
        Deprecated.
        This constructor will be removed in Tomcat 12
        Constructs a new WebXmlParser.
        Parameters:
        namespaceAware - Whether the parser is namespace aware
        validation - Whether validation is enabled
        blockExternal - Whether external entities are blocked
        urlPatternsProvidedInDecodedForm - Whether URL and URL patterns will be provided in decoded form
    • Method Detail

      • parseWebXml

        public boolean parseWebXml​(java.net.URL url,
                                   WebXml dest,
                                   boolean fragment)
                            throws java.io.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:
        java.io.IOException - if there was a problem reading from the URL
      • parseWebXml

        public boolean parseWebXml​(org.xml.sax.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​(java.lang.ClassLoader classLoader)
        Sets the ClassLoader to be used for creating descriptor objects.
        Parameters:
        classLoader - the ClassLoader to be used for creating descriptor objects
      • getUrlPatternsProvidedInDecodedForm

        @Deprecated
        public boolean getUrlPatternsProvidedInDecodedForm()
        Deprecated.
        This method will be removed in Tomcat 12 where it will effectively be hard-coded to true
        Does this parser expect URLs and URL patterns provided in web.xml, annotations and their programmatic equivalents to be in URL-decoded form?
        Returns:
        true if URLs and URL patterns are expected in URL-decoded form, otherwise false