Package org.apache.jasper.servlet
Class TldScanner
java.lang.Object
org.apache.jasper.servlet.TldScanner
- Direct Known Subclasses:
TldPreScanned
Scans for and loads Tag Library Descriptors contained in a web application.
-
Constructor Summary
ConstructorDescriptionTldScanner
(ServletContext context, boolean namespaceAware, boolean validation, boolean blockExternal) Initialise with the application's ServletContext. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of all listeners declared by scanned TLDs.Returns the map of TldResourcePath to parsed XML files built by this scanner.Returns the map of URI to TldResourcePath built by this scanner.protected void
protected void
parseTld
(TldResourcePath path) void
scan()
Scan for TLDs in all places defined by the specification: Tag libraries defined by the platform Entries from <jsp-config> in web.xml A resources under /WEB-INF In jar files from /WEB-INF/lib Additional entries from the containervoid
scanJars()
Scan for TLDs in JARs in /WEB-INF/lib.protected void
Scan for TLDs defined in <jsp-config>.protected void
Scan for TLDs required by the platform specification.protected void
scanResourcePaths
(String startPath) Scan web application resources for TLDs, recursively.void
setClassLoader
(ClassLoader classLoader) Set the class loader used by the digester to create objects as a result of this scan.
-
Constructor Details
-
TldScanner
public TldScanner(ServletContext context, boolean namespaceAware, boolean validation, boolean blockExternal) Initialise with the application's ServletContext.- Parameters:
context
- the application's servletContextnamespaceAware
- should the XML parser used to parse TLD files be configured to be name space awarevalidation
- should the XML parser used to parse TLD files be configured to use validationblockExternal
- should the XML parser used to parse TLD files be configured to be block references to external entities
-
-
Method Details
-
scan
Scan for TLDs in all places defined by the specification:- Tag libraries defined by the platform
- Entries from <jsp-config> in web.xml
- A resources under /WEB-INF
- In jar files from /WEB-INF/lib
- Additional entries from the container
- Throws:
IOException
- if there was a problem scanning for or loading a TLDSAXException
- if there was a problem parsing a TLD
-
getUriTldResourcePathMap
Returns the map of URI to TldResourcePath built by this scanner.- Returns:
- the map of URI to TldResourcePath
-
getTldResourcePathTaglibXmlMap
Returns the map of TldResourcePath to parsed XML files built by this scanner.- Returns:
- the map of TldResourcePath to parsed XML files
-
getListeners
Returns a list of all listeners declared by scanned TLDs.- Returns:
- a list of listener class names
-
setClassLoader
Set the class loader used by the digester to create objects as a result of this scan. Normally this only needs to be set when using JspC.- Parameters:
classLoader
- Class loader to use when creating new objects while parsing TLDs
-
scanPlatform
protected void scanPlatform()Scan for TLDs required by the platform specification. -
scanJspConfig
Scan for TLDs defined in <jsp-config>.- Throws:
IOException
- Error reading resourcesSAXException
- XML parsing error
-
scanResourcePaths
Scan web application resources for TLDs, recursively.- Parameters:
startPath
- the directory resource to scan- Throws:
IOException
- if there was a problem scanning for or loading a TLDSAXException
- if there was a problem parsing a TLD
-
scanJars
public void scanJars()Scan for TLDs in JARs in /WEB-INF/lib. -
parseTld
- Throws:
IOException
SAXException
-
parseTld
- Throws:
IOException
SAXException
-