Java 类javax.servlet.descriptor.TaglibDescriptor 实例源码

项目:marathon-auth-plugin    文件:ServletContextHandler.java   
public String toString()
{
    StringBuffer sb = new StringBuffer();
    sb.append("JspConfigDescriptor: \n");
    for (TaglibDescriptor taglib:_taglibs)
        sb.append(taglib+"\n");
    for (JspPropertyGroupDescriptor jpg:_jspPropertyGroups)
        sb.append(jpg+"\n");
    return sb.toString();
}
项目:tomcat7    文件:TldConfig.java   
/**
 * Get the taglib entries from web.xml and add them to the map.
 * 
 * This is not kept in sync with o.a.j.compiler.TldLocationsCache as this
 * code needs to scan the TLDs listed in web.xml whereas Jasper only needs
 * the URI to TLD mappings.
 */
private void tldScanWebXml() {

    if (log.isTraceEnabled()) {
        log.trace(sm.getString("tldConfig.webxmlStart"));
    }

    Collection<TaglibDescriptor> descriptors =
        context.getJspConfigDescriptor().getTaglibs();

    for (TaglibDescriptor descriptor : descriptors) {
        String resourcePath = descriptor.getTaglibLocation();
        // Note: Whilst the Servlet 2.4 DTD implies that the location must
        // be a context-relative path starting with '/', JSP.7.3.6.1 states
        // explicitly how paths that do not start with '/' should be
        // handled.
        if (!resourcePath.startsWith("/")) {
            resourcePath = WEB_INF + resourcePath;
        }
        if (taglibUris.contains(descriptor.getTaglibURI())) {
            log.warn(sm.getString("tldConfig.webxmlSkip", resourcePath,
                    descriptor.getTaglibURI()));
        } else {
            if (log.isTraceEnabled()) {
                log.trace(sm.getString("tldConfig.webxmlAdd", resourcePath,
                        descriptor.getTaglibURI()));
            }
            InputStream stream = null;
            try {
                stream = context.getServletContext().getResourceAsStream(
                        resourcePath);
                if (stream != null) {
                    XmlErrorHandler handler = tldScanStream(stream);
                    handler.logFindings(log, resourcePath);
                    taglibUris.add(descriptor.getTaglibURI());
                    webxmlTaglibUris.add(descriptor.getTaglibURI());
                } else {
                    log.warn(sm.getString("tldConfig.webxmlFailPathDoesNotExist", resourcePath,
                            descriptor.getTaglibURI()));
                }
            } catch (IOException ioe) {
                log.warn(sm.getString("tldConfig.webxmlFail", resourcePath,
                        descriptor.getTaglibURI()), ioe);
            } finally {
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                    }
                }
            }
        }
    }
}
项目:tomcat7    文件:ApplicationJspConfigDescriptor.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return taglibs;
}
项目:apache-tomcat-7.0.73-with-comment    文件:TldConfig.java   
/**
 * Get the taglib entries from web.xml and add them to the map.
 * 
 * This is not kept in sync with o.a.j.compiler.TldLocationsCache as this
 * code needs to scan the TLDs listed in web.xml whereas Jasper only needs
 * the URI to TLD mappings.
 */
private void tldScanWebXml() {

    if (log.isTraceEnabled()) {
        log.trace(sm.getString("tldConfig.webxmlStart"));
    }

    Collection<TaglibDescriptor> descriptors =
        context.getJspConfigDescriptor().getTaglibs();

    for (TaglibDescriptor descriptor : descriptors) {
        String resourcePath = descriptor.getTaglibLocation();
        // Note: Whilst the Servlet 2.4 DTD implies that the location must
        // be a context-relative path starting with '/', JSP.7.3.6.1 states
        // explicitly how paths that do not start with '/' should be
        // handled.
        if (!resourcePath.startsWith("/")) {
            resourcePath = WEB_INF + resourcePath;
        }
        if (taglibUris.contains(descriptor.getTaglibURI())) {
            log.warn(sm.getString("tldConfig.webxmlSkip", resourcePath,
                    descriptor.getTaglibURI()));
        } else {
            if (log.isTraceEnabled()) {
                log.trace(sm.getString("tldConfig.webxmlAdd", resourcePath,
                        descriptor.getTaglibURI()));
            }
            InputStream stream = null;
            try {
                stream = context.getServletContext().getResourceAsStream(
                        resourcePath);
                if (stream != null) {
                    XmlErrorHandler handler = tldScanStream(stream);
                    handler.logFindings(log, resourcePath);
                    taglibUris.add(descriptor.getTaglibURI());
                    webxmlTaglibUris.add(descriptor.getTaglibURI());
                } else {
                    log.warn(sm.getString("tldConfig.webxmlFailPathDoesNotExist", resourcePath,
                            descriptor.getTaglibURI()));
                }
            } catch (IOException ioe) {
                log.warn(sm.getString("tldConfig.webxmlFail", resourcePath,
                        descriptor.getTaglibURI()), ioe);
            } finally {
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                    }
                }
            }
        }
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:ApplicationJspConfigDescriptor.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return taglibs;
}
项目:marathon-auth-plugin    文件:ServletContextHandler.java   
/**
 * @see javax.servlet.descriptor.JspConfigDescriptor#getTaglibs()
 */
public Collection<TaglibDescriptor> getTaglibs()
{
    return new ArrayList<TaglibDescriptor>(_taglibs);
}
项目:marathon-auth-plugin    文件:ServletContextHandler.java   
public void addTaglibDescriptor (TaglibDescriptor d)
{
    _taglibs.add(d);
}
项目:lazycat    文件:TldConfig.java   
/**
 * Get the taglib entries from web.xml and add them to the map.
 * 
 * This is not kept in sync with o.a.j.compiler.TldLocationsCache as this
 * code needs to scan the TLDs listed in web.xml whereas Jasper only needs
 * the URI to TLD mappings.
 */
private void tldScanWebXml() {

    if (log.isTraceEnabled()) {
        log.trace(sm.getString("tldConfig.webxmlStart"));
    }

    Collection<TaglibDescriptor> descriptors = context.getJspConfigDescriptor().getTaglibs();

    for (TaglibDescriptor descriptor : descriptors) {
        String resourcePath = descriptor.getTaglibLocation();
        // Note: Whilst the Servlet 2.4 DTD implies that the location must
        // be a context-relative path starting with '/', JSP.7.3.6.1 states
        // explicitly how paths that do not start with '/' should be
        // handled.
        if (!resourcePath.startsWith("/")) {
            resourcePath = WEB_INF + resourcePath;
        }
        if (taglibUris.contains(descriptor.getTaglibURI())) {
            log.warn(sm.getString("tldConfig.webxmlSkip", resourcePath, descriptor.getTaglibURI()));
        } else {
            if (log.isTraceEnabled()) {
                log.trace(sm.getString("tldConfig.webxmlAdd", resourcePath, descriptor.getTaglibURI()));
            }
            InputStream stream = null;
            try {
                stream = context.getServletContext().getResourceAsStream(resourcePath);
                if (stream != null) {
                    XmlErrorHandler handler = tldScanStream(stream);
                    handler.logFindings(log, resourcePath);
                    taglibUris.add(descriptor.getTaglibURI());
                    webxmlTaglibUris.add(descriptor.getTaglibURI());
                } else {
                    log.warn(sm.getString("tldConfig.webxmlFailPathDoesNotExist", resourcePath,
                            descriptor.getTaglibURI()));
                }
            } catch (IOException ioe) {
                log.warn(sm.getString("tldConfig.webxmlFail", resourcePath, descriptor.getTaglibURI()), ioe);
            } finally {
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                    }
                }
            }
        }
    }
}
项目:lazycat    文件:ApplicationJspConfigDescriptor.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return taglibs;
}
项目:beyondj    文件:JspConfigDescriptorImpl.java   
public JspConfigDescriptorImpl(Collection<JspPropertyGroupDescriptor> jspPropertyGroups,
                               Collection<TaglibDescriptor> taglibs) {
    this.jspPropertyGroups = jspPropertyGroups;
    this.taglibs = taglibs;
}
项目:beyondj    文件:JspConfigDescriptorImpl.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return new ArrayList<>(taglibs);
}
项目:packagedrone    文件:JspCServletContext.java   
public JspConfigDescriptorImpl(Collection<TaglibDescriptor> taglibs,
           Collection<JspPropertyGroupDescriptor> jspPropertyGroups) {
   this.taglibs = taglibs;
   this.jspPropertyGroups = jspPropertyGroups;
}
项目:packagedrone    文件:JspCServletContext.java   
public Collection<TaglibDescriptor> getTaglibs() {
    return this.taglibs;
}
项目:packagedrone    文件:TldScanner.java   
private void processWebDotXml() throws Exception {


        // Skip if we are only looking for listeners
        if (scanListeners) {
            return;
        }

        JspConfigDescriptor jspConfig = ctxt.getJspConfigDescriptor();
        if (jspConfig == null) {
            return;
        }

        for (TaglibDescriptor taglib: jspConfig.getTaglibs()) {

            if (taglib == null) {
                continue;
            }
            String tagUri = taglib.getTaglibURI();
            String tagLoc = taglib.getTaglibLocation();
            if (tagUri == null || tagLoc == null) {
                continue;
            }
            // Ignore system tlds in web.xml, for backward compatibility
            if (systemUris.contains(tagUri)
                        || (!useMyFaces && systemUrisJsf.contains(tagUri))) {
                continue;
            }
            // Save this location if appropriate
            if (uriType(tagLoc) == NOROOT_REL_URI)
                    tagLoc = "/WEB-INF/" + tagLoc;
            String tagLoc2 = null;
            if (tagLoc.endsWith(JAR_FILE_SUFFIX)) {
                tagLoc = ctxt.getResource(tagLoc).toString();
                tagLoc2 = "META-INF/taglib.tld";
            }
            if (log.isLoggable(Level.FINE)) {
                log.fine( "Add tld map from web.xml: " + tagUri + "=>" + tagLoc+ "," + tagLoc2);
            }
            mappings.put(tagUri, new String[] { tagLoc, tagLoc2 });
        }
    }
项目:class-guard    文件:TldConfig.java   
/**
 * Get the taglib entries from web.xml and add them to the map.
 * 
 * This is not kept in sync with o.a.j.compiler.TldLocationsCache as this
 * code needs to scan the TLDs listed in web.xml whereas Jasper only needs
 * the URI to TLD mappings.
 */
private void tldScanWebXml() {

    if (log.isTraceEnabled()) {
        log.trace(sm.getString("tldConfig.webxmlStart"));
    }

    Collection<TaglibDescriptor> descriptors =
        context.getJspConfigDescriptor().getTaglibs();

    for (TaglibDescriptor descriptor : descriptors) {
        String resourcePath = descriptor.getTaglibLocation();
        // Note: Whilst the Servlet 2.4 DTD implies that the location must
        // be a context-relative path starting with '/', JSP.7.3.6.1 states
        // explicitly how paths that do not start with '/' should be
        // handled.
        if (!resourcePath.startsWith("/")) {
            resourcePath = WEB_INF + resourcePath;
        }
        if (taglibUris.contains(descriptor.getTaglibURI())) {
            log.warn(sm.getString("tldConfig.webxmlSkip", resourcePath,
                    descriptor.getTaglibURI()));
        } else {
            if (log.isTraceEnabled()) {
                log.trace(sm.getString("tldConfig.webxmlAdd", resourcePath,
                        descriptor.getTaglibURI()));
            }
            InputStream stream = null;
            try {
                stream = context.getServletContext().getResourceAsStream(
                        resourcePath);
                if (stream != null) {
                    XmlErrorHandler handler = tldScanStream(stream);
                    handler.logFindings(log, resourcePath);
                    taglibUris.add(descriptor.getTaglibURI());
                    webxmlTaglibUris.add(descriptor.getTaglibURI());
                } else {
                    log.warn(sm.getString("tldConfig.webxmlFailPathDoesNotExist", resourcePath,
                            descriptor.getTaglibURI()));
                }
            } catch (IOException ioe) {
                log.warn(sm.getString("tldConfig.webxmlFail", resourcePath,
                        descriptor.getTaglibURI()), ioe);
            } finally {
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                    }
                }
            }
        }
    }
}
项目:class-guard    文件:ApplicationJspConfigDescriptor.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return taglibs;
}
项目:package-drone    文件:JspCServletContext.java   
public JspConfigDescriptorImpl(Collection<TaglibDescriptor> taglibs,
           Collection<JspPropertyGroupDescriptor> jspPropertyGroups) {
   this.taglibs = taglibs;
   this.jspPropertyGroups = jspPropertyGroups;
}
项目:package-drone    文件:JspCServletContext.java   
public Collection<TaglibDescriptor> getTaglibs() {
    return this.taglibs;
}
项目:package-drone    文件:TldScanner.java   
private void processWebDotXml() throws Exception {


        // Skip if we are only looking for listeners
        if (scanListeners) {
            return;
        }

        JspConfigDescriptor jspConfig = ctxt.getJspConfigDescriptor();
        if (jspConfig == null) {
            return;
        }

        for (TaglibDescriptor taglib: jspConfig.getTaglibs()) {

            if (taglib == null) {
                continue;
            }
            String tagUri = taglib.getTaglibURI();
            String tagLoc = taglib.getTaglibLocation();
            if (tagUri == null || tagLoc == null) {
                continue;
            }
            // Ignore system tlds in web.xml, for backward compatibility
            if (systemUris.contains(tagUri)
                        || (!useMyFaces && systemUrisJsf.contains(tagUri))) {
                continue;
            }
            // Save this location if appropriate
            if (uriType(tagLoc) == NOROOT_REL_URI)
                    tagLoc = "/WEB-INF/" + tagLoc;
            String tagLoc2 = null;
            if (tagLoc.endsWith(JAR_FILE_SUFFIX)) {
                tagLoc = ctxt.getResource(tagLoc).toString();
                tagLoc2 = "META-INF/taglib.tld";
            }
            if (log.isLoggable(Level.FINE)) {
                log.fine( "Add tld map from web.xml: " + tagUri + "=>" + tagLoc+ "," + tagLoc2);
            }
            mappings.put(tagUri, new String[] { tagLoc, tagLoc2 });
        }
    }
项目:apache-tomcat-7.0.57    文件:TldConfig.java   
/**
 * Get the taglib entries from web.xml and add them to the map.
 * 
 * This is not kept in sync with o.a.j.compiler.TldLocationsCache as this
 * code needs to scan the TLDs listed in web.xml whereas Jasper only needs
 * the URI to TLD mappings.
 */
private void tldScanWebXml() {

    if (log.isTraceEnabled()) {
        log.trace(sm.getString("tldConfig.webxmlStart"));
    }

    Collection<TaglibDescriptor> descriptors =
        context.getJspConfigDescriptor().getTaglibs();

    for (TaglibDescriptor descriptor : descriptors) {
        String resourcePath = descriptor.getTaglibLocation();
        // Note: Whilst the Servlet 2.4 DTD implies that the location must
        // be a context-relative path starting with '/', JSP.7.3.6.1 states
        // explicitly how paths that do not start with '/' should be
        // handled.
        if (!resourcePath.startsWith("/")) {
            resourcePath = WEB_INF + resourcePath;
        }
        if (taglibUris.contains(descriptor.getTaglibURI())) {
            log.warn(sm.getString("tldConfig.webxmlSkip", resourcePath,
                    descriptor.getTaglibURI()));
        } else {
            if (log.isTraceEnabled()) {
                log.trace(sm.getString("tldConfig.webxmlAdd", resourcePath,
                        descriptor.getTaglibURI()));
            }
            InputStream stream = null;
            try {
                stream = context.getServletContext().getResourceAsStream(
                        resourcePath);
                if (stream != null) {
                    XmlErrorHandler handler = tldScanStream(stream);
                    handler.logFindings(log, resourcePath);
                    taglibUris.add(descriptor.getTaglibURI());
                    webxmlTaglibUris.add(descriptor.getTaglibURI());
                } else {
                    log.warn(sm.getString("tldConfig.webxmlFailPathDoesNotExist", resourcePath,
                            descriptor.getTaglibURI()));
                }
            } catch (IOException ioe) {
                log.warn(sm.getString("tldConfig.webxmlFail", resourcePath,
                        descriptor.getTaglibURI()), ioe);
            } finally {
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                    }
                }
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:ApplicationJspConfigDescriptor.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return taglibs;
}
项目:apache-tomcat-7.0.57    文件:TldConfig.java   
/**
 * Get the taglib entries from web.xml and add them to the map.
 * 
 * This is not kept in sync with o.a.j.compiler.TldLocationsCache as this
 * code needs to scan the TLDs listed in web.xml whereas Jasper only needs
 * the URI to TLD mappings.
 */
private void tldScanWebXml() {

    if (log.isTraceEnabled()) {
        log.trace(sm.getString("tldConfig.webxmlStart"));
    }

    Collection<TaglibDescriptor> descriptors =
        context.getJspConfigDescriptor().getTaglibs();

    for (TaglibDescriptor descriptor : descriptors) {
        String resourcePath = descriptor.getTaglibLocation();
        // Note: Whilst the Servlet 2.4 DTD implies that the location must
        // be a context-relative path starting with '/', JSP.7.3.6.1 states
        // explicitly how paths that do not start with '/' should be
        // handled.
        if (!resourcePath.startsWith("/")) {
            resourcePath = WEB_INF + resourcePath;
        }
        if (taglibUris.contains(descriptor.getTaglibURI())) {
            log.warn(sm.getString("tldConfig.webxmlSkip", resourcePath,
                    descriptor.getTaglibURI()));
        } else {
            if (log.isTraceEnabled()) {
                log.trace(sm.getString("tldConfig.webxmlAdd", resourcePath,
                        descriptor.getTaglibURI()));
            }
            InputStream stream = null;
            try {
                stream = context.getServletContext().getResourceAsStream(
                        resourcePath);
                if (stream != null) {
                    XmlErrorHandler handler = tldScanStream(stream);
                    handler.logFindings(log, resourcePath);
                    taglibUris.add(descriptor.getTaglibURI());
                    webxmlTaglibUris.add(descriptor.getTaglibURI());
                } else {
                    log.warn(sm.getString("tldConfig.webxmlFailPathDoesNotExist", resourcePath,
                            descriptor.getTaglibURI()));
                }
            } catch (IOException ioe) {
                log.warn(sm.getString("tldConfig.webxmlFail", resourcePath,
                        descriptor.getTaglibURI()), ioe);
            } finally {
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                    }
                }
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:ApplicationJspConfigDescriptor.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return taglibs;
}
项目:WBSAirback    文件:TldConfig.java   
/**
 * Get the taglib entries from web.xml and add them to the map.
 * 
 * This is not kept in sync with o.a.j.compiler.TldLocationsCache as this
 * code needs to scan the TLDs listed in web.xml whereas Jasper only needs
 * the URI to TLD mappings.
 */
private void tldScanWebXml() {

    if (log.isTraceEnabled()) {
        log.trace(sm.getString("tldConfig.webxmlStart"));
    }

    Collection<TaglibDescriptor> descriptors =
        context.getJspConfigDescriptor().getTaglibs();

    for (TaglibDescriptor descriptor : descriptors) {
        String resourcePath = descriptor.getTaglibLocation();
        // Note: Whilst the Servlet 2.4 DTD implies that the location must
        // be a context-relative path starting with '/', JSP.7.3.6.1 states
        // explicitly how paths that do not start with '/' should be
        // handled.
        if (!resourcePath.startsWith("/")) {
            resourcePath = WEB_INF + resourcePath;
        }
        if (taglibUris.contains(descriptor.getTaglibURI())) {
            log.warn(sm.getString("tldConfig.webxmlSkip", resourcePath,
                    descriptor.getTaglibURI()));
        } else {
            if (log.isTraceEnabled()) {
                log.trace(sm.getString("tldConfig.webxmlAdd", resourcePath,
                        descriptor.getTaglibURI()));
            }
            InputStream stream = null;
            try {
                stream = context.getServletContext().getResourceAsStream(
                        resourcePath);
                XmlErrorHandler handler = tldScanStream(stream);
                handler.logFindings(log, resourcePath);
                taglibUris.add(descriptor.getTaglibURI());
                webxmlTaglibUris.add(descriptor.getTaglibURI());
            } catch (IOException ioe) {
                log.warn(sm.getString("tldConfig.webxmlFail", resourcePath,
                        descriptor.getTaglibURI()), ioe);
            } finally {
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                    }
                }
            }
        }
    }
}
项目:WBSAirback    文件:ApplicationJspConfigDescriptor.java   
@Override
public Collection<TaglibDescriptor> getTaglibs() {
    return taglibs;
}