bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/TldScanner.java
private TldInfo scanTld(String resourcePath, String entryName,
                         InputStream stream)
                throws JasperException {
        try {
            // Parse the tag library descriptor at the specified resource path
            TreeNode tld = new ParserUtils().parseXMLDocument(
                                resourcePath, stream, isValidationEnabled);

            String uri = null;
            TreeNode uriNode = tld.findChild("uri");
            if (uriNode != null) {
                uri = uriNode.getBody();
            }

            ArrayList<String> listeners = new ArrayList<String>();

            Iterator<TreeNode>listenerNodes = tld.findChildren("listener");
            while (listenerNodes.hasNext()) {
                TreeNode listener = listenerNodes.next();
                TreeNode listenerClass = listener.findChild("listener-class");
                if (listenerClass != null) {
                    String listenerClassName = listenerClass.getBody();
                    if (listenerClassName != null) {
                        listeners.add(listenerClassName);
                    }
                }
            }

            return new TldInfo(uri, entryName,
                               listeners.toArray(new String[listeners.size()]));

        } finally {
            if (stream != null) {
                try {
                    stream.close();
                } catch (Throwable t) {
                    // do nothing
                }
            }
        }
    }
private TldInfo scanTld(String resourcePath, String entryName,
                         InputStream stream)
                throws JasperException {
        try {
            // Parse the tag library descriptor at the specified resource path
            TreeNode tld = new ParserUtils().parseXMLDocument(
                                resourcePath, stream, isValidationEnabled);

            String uri = null;
            TreeNode uriNode = tld.findChild("uri");
            if (uriNode != null) {
                uri = uriNode.getBody();
            }

            ArrayList<String> listeners = new ArrayList<String>();

            Iterator<TreeNode>listenerNodes = tld.findChildren("listener");
            while (listenerNodes.hasNext()) {
                TreeNode listener = listenerNodes.next();
                TreeNode listenerClass = listener.findChild("listener-class");
                if (listenerClass != null) {
                    String listenerClassName = listenerClass.getBody();
                    if (listenerClassName != null) {
                        listeners.add(listenerClassName);
                    }
                }
            }

            return new TldInfo(uri, entryName,
                               listeners.toArray(new String[listeners.size()]));

        } finally {
            if (stream != null) {
                try {
                    stream.close();
                } catch (Throwable t) {
                    // do nothing
                }
            }
        }
    }
private TldInfo scanTld ( String resourcePath , String entryName , InputStream stream ) throws JasperException { try { // Parse the tag library descriptor at the specified resource path TreeNode tld = new ParserUtils ( ) . parseXMLDocument ( resourcePath , stream , isValidationEnabled ) ; String uri = null ; TreeNode uriNode = tld . findChild ( "uri" ) ; if ( uriNode != null ) { uri = uriNode . getBody ( ) ; } ArrayList < String > listeners = new ArrayList < String > ( ) ; Iterator < TreeNode > listenerNodes = tld . findChildren ( "listener" ) ; while ( listenerNodes . hasNext ( ) ) { TreeNode listener = listenerNodes . next ( ) ; TreeNode listenerClass = listener . findChild ( "listener-class" ) ; if ( listenerClass != null ) { String listenerClassName = listenerClass . getBody ( ) ; if ( listenerClassName != null ) { listeners . add ( listenerClassName ) ; } } } return new TldInfo ( uri , entryName , listeners . toArray ( new String [ listeners . size ( ) ] ) ) ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( Throwable t ) { // do nothing } } } }
Scan the given TLD for uri and listeners elements.

@param resourcePath the resource path for the jar file or the tld file.
@param entryName If the resource path is a jar file, then the name of
the tld file in the jar, else should be null.
@param stream The input stream for the tld
@return The TldInfo for this tld
Scan the given TLD for uri and listeners elements .