bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspDocumentParser.java
private void addTaglibInfo(String prefix, String uri)
        throws JasperException {

        if (uri.startsWith(URN_JSPTAGDIR)) {
            // uri (of the form "urn:jsptagdir:path") references tag file dir
            String tagdir = uri.substring(URN_JSPTAGDIR.length());
            TagLibraryInfo taglibInfo = new ImplicitTagLibraryInfo(
                    ctxt,
                    parserController,
                    prefix,
                    tagdir,
                    err);
            if (pageInfo.getTaglib(uri) == null) {
                pageInfo.addTaglib(uri, taglibInfo);
            }
            pageInfo.pushPrefixMapping(prefix, uri);

        } else {
            // uri references TLD file
            boolean isPlainUri = false;
            if (uri.startsWith(TagConstants.URN_JSPTLD)) {
                uri = uri.substring(TagConstants.URN_JSPTLD.length());
            } else {
                isPlainUri = true;
            }

            // START GlassFish 750
            ConcurrentHashMap<String, TagLibraryInfoImpl> taglibs =
                ctxt.getTaglibs();
            TagLibraryInfoImpl taglibInfo = taglibs.get(uri);
            if (taglibInfo == null) {
                synchronized (taglibs) {
                    taglibInfo = taglibs.get(uri);
                    if (taglibInfo == null) {
            // END GlassFish 750            
                        String[] location = ctxt.getTldLocation(uri);
                        if (location != null || !isPlainUri) {
                            /*
                             * If the uri value is a plain uri, a translation
                             * error must not be generated if the uri is not
                             * found in the taglib map.
                             * Instead, any actions in the namespace defined
                             * by the uri value must be treated as
                             * uninterpreted.
                             */
                            taglibInfo =
                                new TagLibraryInfoImpl(
                                    ctxt,
                                    parserController,
                                    prefix,
                                    uri,
                                    location,
                                    err);
                            // START GlassFish 750
                            ctxt.addTaglib(uri, taglibInfo);
                            pageInfo.addTaglib(uri, taglibInfo);
                            // END GlassFish 750
                        }
            // START GlassFish 750
                    }
                }
            }
            // END GlassFish 750

            if (taglibInfo != null) {
                if (pageInfo.getTaglib(uri) == null) {
                    pageInfo.addTaglib(uri,
                                       new TagLibraryInfoImpl(prefix,
                                                              uri,
                                                              taglibInfo,
                                                              pageInfo));
                }
                pageInfo.pushPrefixMapping(prefix, uri);
            } else {
                pageInfo.pushPrefixMapping(prefix, null);
            }
        }
    }
private void addTaglibInfo(String prefix, String uri)
        throws JasperException {

        if (uri.startsWith(URN_JSPTAGDIR)) {
            // uri (of the form "urn:jsptagdir:path") references tag file dir
            String tagdir = uri.substring(URN_JSPTAGDIR.length());
            TagLibraryInfo taglibInfo = new ImplicitTagLibraryInfo(
                    ctxt,
                    parserController,
                    prefix,
                    tagdir,
                    err);
            if (pageInfo.getTaglib(uri) == null) {
                pageInfo.addTaglib(uri, taglibInfo);
            }
            pageInfo.pushPrefixMapping(prefix, uri);

        } else {
            // uri references TLD file
            boolean isPlainUri = false;
            if (uri.startsWith(TagConstants.URN_JSPTLD)) {
                uri = uri.substring(TagConstants.URN_JSPTLD.length());
            } else {
                isPlainUri = true;
            }

            // START GlassFish 750
            ConcurrentHashMap<String, TagLibraryInfoImpl> taglibs =
                ctxt.getTaglibs();
            TagLibraryInfoImpl taglibInfo = taglibs.get(uri);
            if (taglibInfo == null) {
                synchronized (taglibs) {
                    taglibInfo = taglibs.get(uri);
                    if (taglibInfo == null) {
            // END GlassFish 750            
                        String[] location = ctxt.getTldLocation(uri);
                        if (location != null || !isPlainUri) {
                            /*
                             * If the uri value is a plain uri, a translation
                             * error must not be generated if the uri is not
                             * found in the taglib map.
                             * Instead, any actions in the namespace defined
                             * by the uri value must be treated as
                             * uninterpreted.
                             */
                            taglibInfo =
                                new TagLibraryInfoImpl(
                                    ctxt,
                                    parserController,
                                    prefix,
                                    uri,
                                    location,
                                    err);
                            // START GlassFish 750
                            ctxt.addTaglib(uri, taglibInfo);
                            pageInfo.addTaglib(uri, taglibInfo);
                            // END GlassFish 750
                        }
            // START GlassFish 750
                    }
                }
            }
            // END GlassFish 750

            if (taglibInfo != null) {
                if (pageInfo.getTaglib(uri) == null) {
                    pageInfo.addTaglib(uri,
                                       new TagLibraryInfoImpl(prefix,
                                                              uri,
                                                              taglibInfo,
                                                              pageInfo));
                }
                pageInfo.pushPrefixMapping(prefix, uri);
            } else {
                pageInfo.pushPrefixMapping(prefix, null);
            }
        }
    }
/*
Adds the tag library associated with the given uri namespace to the
translation unit that this parser is associated with.

If the tag library does not exist, it is created.

@param prefix The prefix of the xmlns attribute
@param uri The uri namespace (value of the xmlns attribute)