Class WebXmlParser
java.lang.Object
org.apache.tomcat.util.descriptor.web.WebXmlParser
Parser for web.xml and web-fragment.xml deployment descriptors.
-
Constructor Summary
ConstructorsConstructorDescriptionWebXmlParser(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
Modifier and TypeMethodDescriptionbooleanDeprecated.This method will be removed in Tomcat 12 where it will effectively be hard-coded totruebooleanparseWebXml(URL url, WebXml dest, boolean fragment) Parse a web descriptor at a location.booleanparseWebXml(InputSource source, WebXml dest, boolean fragment) Parses a web descriptor from an InputSource.voidsetClassLoader(ClassLoader classLoader) Sets the ClassLoader to be used for creating descriptor objects.
-
Constructor Details
-
WebXmlParser
public WebXmlParser(boolean namespaceAware, boolean validation, boolean blockExternal) Constructs a new WebXmlParser.- Parameters:
namespaceAware- Whether the parser is namespace awarevalidation- Whether validation is enabledblockExternal- 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 12Constructs a new WebXmlParser.- Parameters:
namespaceAware- Whether the parser is namespace awarevalidation- Whether validation is enabledblockExternal- Whether external entities are blockedurlPatternsProvidedInDecodedForm- Whether URL and URL patterns will be provided in decoded form
-
-
Method Details
-
parseWebXml
Parse a web descriptor at a location.- Parameters:
url- the location; if null no load will be attempteddest- the instance to be populated by the parse operationfragment- 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
Parses a web descriptor from an InputSource.- Parameters:
source- The input sourcedest- The WebXml instance to populatefragment- Whether this is a web-fragment- Returns:
trueif parsing was successful
-
setClassLoader
Sets the ClassLoader to be used for creating descriptor objects.- Parameters:
classLoader- the ClassLoader to be used for creating descriptor objects
-
getUrlPatternsProvidedInDecodedForm
Deprecated.This method will be removed in Tomcat 12 where it will effectively be hard-coded totrueDoes this parser expect URLs and URL patterns provided in web.xml, annotations and their programmatic equivalents to be in URL-decoded form?- Returns:
trueif URLs and URL patterns are expected in URL-decoded form, otherwisefalse
-