Examples of TaglibXml


Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                }
            }
        }

        // Get the representation of the TLD
        TaglibXml taglibXml =
                ctxt.getOptions().getTldCache().getTaglibXml(tldResourcePath);

        // Populate the TagLibraryInfo attributes
        this.jspversion = taglibXml.getJspVersion();
        this.tlibversion = taglibXml.getTlibVersion();
        this.shortname = taglibXml.getShortName();
        this.urn = taglibXml.getUri();
        this.info = taglibXml.getInfo();

        this.tagLibraryValidator = createValidator(taglibXml.getValidator());

        List<TagInfo> tagInfos = new ArrayList<>();
        for (TagXml tagXml : taglibXml.getTags()) {
            tagInfos.add(createTagInfo(tagXml));
        }

        List<TagFileInfo> tagFileInfos = new ArrayList<>();
        for (TagFileXml tagFileXml : taglibXml.getTagFiles()) {
            tagFileInfos.add(createTagFileInfo(tagFileXml, jar));
        }

        Set<String> names = new HashSet<>();
        List<FunctionInfo> functionInfos = taglibXml.getFunctions();
        // TODO Move this validation to the parsing stage
        for (FunctionInfo functionInfo : functionInfos) {
            String name = functionInfo.getName();
            if (!names.add(name)) {
                err.jspError("jsp.error.tld.fn.duplicate.name", name, uri);
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                    tldResourcePath = new TldResourcePath(url, resourcePath, "META-INF/taglib.tld");
                } else {
                    tldResourcePath = new TldResourcePath(url, resourcePath);
                }
                // parse TLD but store using the URI supplied in the descriptor
                TaglibXml tld = tldParser.parse(tldResourcePath);
                uriTldResourcePathMap.put(taglibURI, tldResourcePath);
                tldResourcePathTaglibXmlMap.put(tldResourcePath, tld);
                if (tld.getListeners() != null) {
                    listeners.addAll(tld.getListeners());
                }
            } else {
                log.warn(Localizer.getMessage(MSG + ".webxmlFailPathDoesNotExist",
                        resourcePath,
                        taglibURI));
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

    private void parseTld(TldResourcePath path) throws IOException, SAXException {
        if (tldResourcePathTaglibXmlMap.containsKey(path)) {
            // TLD has already been parsed as a result of processing web.xml
            return;
        }
        TaglibXml tld = tldParser.parse(path);
        String uri = tld.getUri();
        if (uri != null) {
            if (!uriTldResourcePathMap.containsKey(uri)) {
                uriTldResourcePathMap.put(uri, path);
            }
        }
        tldResourcePathTaglibXmlMap.put(path, tld);
        if (tld.getListeners() != null) {
            listeners.addAll(tld.getListeners());
        }
    }
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                    String tagName = path.substring(path.lastIndexOf("/") + 1);
                    tagName = tagName.substring(0,
                            tagName.lastIndexOf(suffix));
                    tagFileMap.put(tagName, path);
                } else if (path.endsWith(IMPLICIT_TLD)) {
                    TaglibXml taglibXml;
                    try {
                        URL url = ctxt.getResource(path);
                        TldResourcePath resourcePath = new TldResourcePath(url, path);
                        ServletContext servletContext = ctxt.getServletContext();
                        boolean validate = Boolean.parseBoolean(
                                servletContext.getInitParameter(
                                        Constants.XML_VALIDATION_TLD_INIT_PARAM));
                        String blockExternalString = servletContext.getInitParameter(
                                Constants.XML_BLOCK_EXTERNAL_INIT_PARAM);
                        boolean blockExternal;
                        if (blockExternalString == null) {
                            blockExternal = Constants.IS_SECURITY_ENABLED;
                        } else {
                            blockExternal = Boolean.parseBoolean(blockExternalString);
                        }
                        TldParser parser = new TldParser(true, validate,
                                new ImplicitTldRuleSet(), blockExternal);
                        taglibXml = parser.parse(resourcePath);
                    } catch (IOException | SAXException e) {
                        err.jspError(e);
                        // unreached
                        throw new JasperException(e);
                    }
                    this.tlibversion = taglibXml.getTlibVersion();
                    this.jspversion = taglibXml.getJspVersion();
                    try {
                        double version = Double.parseDouble(this.jspversion);
                        if (version < 2.0) {
                            err.jspError("jsp.error.invalid.implicit.version", path);
                        }
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                lastModified[1] != cacheEntry.getEntryLastModified()) {
            synchronized (cacheEntry) {
                if (lastModified[0] != cacheEntry.getWebAppPathLastModified() ||
                        lastModified[1] != cacheEntry.getEntryLastModified()) {
                    // Re-parse TLD
                    TaglibXml updatedTaglibXml;
                    try {
                        updatedTaglibXml = tldParser.parse(tldResourcePath);
                    } catch (IOException | SAXException e) {
                        throw new JasperException(e);
                    }
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                tldResourcePath = new TldResourcePath(url, "META-INF/taglib.tld");
            } else {
                tldResourcePath = new TldResourcePath(url);
            }
            // parse TLD but store using the URI supplied in the descriptor
            TaglibXml tld = tldParser.parse(tldResourcePath);
            taglibMap.put(taglibURI, tldResourcePath);
            tldCache.put(tldResourcePath, tld);
            if (tld.getListeners() != null) {
                listeners.addAll(tld.getListeners());
            }
        }
    }
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                new TldResourcePath(context.getResource(resourcePath));
        parseTld(tldResourcePath);
    }

    private void parseTld(TldResourcePath path) throws IOException, SAXException {
        TaglibXml tld = tldParser.parse(path);
        String uri = tld.getUri();
        if (uri != null) {
            if (!taglibMap.containsKey(uri)) {
                taglibMap.put(uri, path);
            }
        }
        tldCache.put(path, tld);
        if (tld.getListeners() != null) {
            listeners.addAll(tld.getListeners());
        }
    }
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                lastModified[1] != cacheEntry.getEntryLastModified()) {
            synchronized (cacheEntry) {
                if (lastModified[0] != cacheEntry.getWebAppPathLastModified() ||
                        lastModified[1] != cacheEntry.getEntryLastModified()) {
                    // Re-parse TLD
                    TaglibXml updatedTaglibXml;
                    try {
                        updatedTaglibXml = tldParser.parse(tldResourcePath);
                    } catch (IOException | SAXException e) {
                        throw new JasperException(e);
                    }
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                tldResourcePath = new TldResourcePath(url, "META-INF/taglib.tld");
            } else {
                tldResourcePath = new TldResourcePath(url);
            }
            // parse TLD but store using the URI supplied in the descriptor
            TaglibXml tld = tldParser.parse(tldResourcePath);
            taglibMap.put(taglibURI, tldResourcePath);
            tldCache.put(tldResourcePath, tld);
            if (tld.getListeners() != null) {
                listeners.addAll(tld.getListeners());
            }
        }
    }
View Full Code Here

Examples of org.apache.tomcat.util.descriptor.tld.TaglibXml

                new TldResourcePath(context.getResource(resourcePath));
        parseTld(tldResourcePath);
    }

    private void parseTld(TldResourcePath path) throws IOException, SAXException {
        TaglibXml tld = tldParser.parse(path);
        String uri = tld.getUri();
        if (uri != null) {
            if (!taglibMap.containsKey(uri)) {
                taglibMap.put(uri, path);
            }
        }
        tldCache.put(path, tld);
        if (tld.getListeners() != null) {
            listeners.addAll(tld.getListeners());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.