Package javax.servlet.jsp.tagext

Examples of javax.servlet.jsp.tagext.TagFileInfo


            this.pageInfo = compiler.getPageInfo();
        }

        @Override
        public void visit(Node.CustomTag n) throws JasperException {
            TagFileInfo tagFileInfo = n.getTagFileInfo();
            if (tagFileInfo != null) {
                String tagFilePath = tagFileInfo.getPath();
                if (tagFilePath.startsWith("/META-INF/")) {
                    // For tags in JARs, add the TLD and the tag as a dependency
                    TldLocation location =
                        compiler.getCompilationContext().getTldLocation(
                            tagFileInfo.getTagInfo().getTagLibrary().getURI());
                    JarResource jarResource = location.getJarResource();
                    if (jarResource != null) {
                        // Add TLD
                        pageInfo.addDependant(jarResource.getEntry(location.getName()).toString());
                        // Add Tag
View Full Code Here


        if (tagLibInfo == null) {
            return null;
        }

        TagInfo tagInfo = tagLibInfo.getTag(localName);
        TagFileInfo tagFileInfo = tagLibInfo.getTagFile(localName);
        if (tagInfo == null && tagFileInfo == null) {
            throw new SAXException(MESSAGES.unknownTag(localName, uri));
        }
        Class tagHandlerClass = null;
        if (tagInfo != null) {
View Full Code Here

            TagInfo tagInfo = createTagInfo(tagInfosArray[i]);
            tagInfos.add(tagInfo);
        }
        org.apache.jasper.deploy.TagFileInfo tagFileInfosArray[] = tagLibraryInfo.getTagFileInfos();
        for (int i = 0; i < tagFileInfosArray.length; i++) {
            TagFileInfo tagFileInfo = createTagFileInfo(tagFileInfosArray[i], jarFileUrl);
            tagFileInfos.add(tagFileInfo);
        }
        org.apache.jasper.deploy.FunctionInfo functionInfosArray[] = tagLibraryInfo.getFunctionInfos();
        for (int i = 0; i < functionInfosArray.length; i++) {
            FunctionInfo functionInfo = createFunctionInfo(functionInfosArray[i]);
View Full Code Here

        } else if (!path.startsWith("/WEB-INF/tags")) {
            err.jspError(MESSAGES.invalidTagFileDirectory(path));
        }
        TagInfo tagInfo = TagFileProcessor.parseTagFileDirectives(
                parserController, name, path, jarFileUrl, this);
        return new TagFileInfo(name, path, tagInfo);
    }
View Full Code Here

     * @return the TagFileInfo for the specified Tag file, or null
     *         if no Tag file is found
     * @since JSP 2.0
     */
    public TagFileInfo getTagFile(String shortname) {
        TagFileInfo tagFiles[] = getTagFiles();

        if (tagFiles == null || tagFiles.length == 0) {
            return null;
        }

View Full Code Here

            return false;
        }

        TagLibraryInfo tagLibInfo = pageInfo.getTaglib(uri);
        TagInfo tagInfo = tagLibInfo.getTag(shortTagName);
        TagFileInfo tagFileInfo = tagLibInfo.getTagFile(shortTagName);
        if (tagInfo == null && tagFileInfo == null) {
            err.jspError(start, MESSAGES.unknownTagPrefix(shortTagName, prefix));
        }
        Class tagHandlerClass = null;
        if (tagInfo != null) {
            // Must be a classic tag, load it here.
            // tag files will be loaded later, in TagFileProcessor
            String handlerClassName = tagInfo.getTagClassName();
            try {
                tagHandlerClass = ctxt.getClassLoader().loadClass(
                        handlerClassName);
            } catch (Exception e) {
                err.jspError(start, MESSAGES.errorLoadingTagHandler(handlerClassName, tagName));
            }
        }

        // Parse 'CustomActionBody' production:
        // At this point we are committed - if anything fails, we produce
        // a translation error.

        // Parse 'Attributes' production:
        Attributes attrs = parseAttributes();
        reader.skipSpaces();

        // Parse 'CustomActionEnd' production:
        if (reader.matches("/>")) {
            if (tagInfo != null) {
                new Node.CustomTag(tagName, prefix, shortTagName, uri, attrs,
                        start, parent, tagInfo, tagHandlerClass);
            } else {
                new Node.CustomTag(tagName, prefix, shortTagName, uri, attrs,
                        start, parent, tagFileInfo);
            }
            return true;
        }

        // Now we parse one of 'CustomActionTagDependent',
        // 'CustomActionJSPContent', or 'CustomActionScriptlessContent'.
        // depending on body-content in TLD.

        // Looking for a body, it still can be empty; but if there is a
        // a tag body, its syntax would be dependent on the type of
        // body content declared in the TLD.
        String bc;
        if (tagInfo != null) {
            bc = tagInfo.getBodyContent();
        } else {
            bc = tagFileInfo.getTagInfo().getBodyContent();
        }

        Node tagNode = null;
        if (tagInfo != null) {
            tagNode = new Node.CustomTag(tagName, prefix, shortTagName, uri,
View Full Code Here

            this.compiler = compiler;
            this.pageInfo = compiler.getPageInfo();
        }

        public void visit(Node.CustomTag n) throws JasperException {
            TagFileInfo tagFileInfo = n.getTagFileInfo();
            if (tagFileInfo != null) {
                String tagFilePath = tagFileInfo.getPath();
                if (tagFilePath.startsWith("/META-INF/")) {
                    // For tags in JARs, add the TLD and the tag as a dependency
                    String[] location =
                        compiler.getCompilationContext().getTldLocation(
                                tagFileInfo.getTagInfo().getTagLibrary().getURI());
                    // Add TLD
                    pageInfo.addDependant("jar:" + location[0] + "!/" +
                            location[1]);
                    // Add Tag
                    pageInfo.addDependant("jar:" + location[0] + "!" +
View Full Code Here

     * @return The TagFileInfo corresponding to the given tag name, or null if
     * the given tag name is not implemented as a tag file
     */
    public TagFileInfo getTagFile(String shortName) {

        TagFileInfo tagFile = super.getTagFile(shortName);
        if (tagFile == null) {
            String path = (String) tagFileMap.get(shortName);
            if (path == null) {
                return null;
            }

            TagInfo tagInfo = null;
            try {
                tagInfo = TagFileProcessor.parseTagFileDirectives(pc,
                        shortName,
                        path,
                        pc.getJspCompilationContext().getTagFileJarUrl(path),
                        this);
            } catch (JasperException je) {
                throw new RuntimeException(je.toString(), je);
            }

            tagFile = new TagFileInfo(shortName, path, tagInfo);
            vec.addElement(tagFile);

            this.tagFiles = new TagFileInfo[vec.size()];
            vec.copyInto(this.tagFiles);
        }
View Full Code Here

      return false;
  }

        TagLibraryInfo tagLibInfo = (TagLibraryInfo) taglibs.get(uri);
  TagInfo tagInfo = tagLibInfo.getTag(shortTagName);
  TagFileInfo tagFileInfo = tagLibInfo.getTagFile(shortTagName);
  if (tagInfo == null && tagFileInfo == null) {
      err.jspError(start, "jsp.error.bad_tag", shortTagName, prefix);
  }
  Class tagHandlerClass = null;
  if (tagInfo != null) {
      // Must be a classic tag, load it here.
      // tag files will be loaded later, in TagFileProcessor
      String handlerClassName = tagInfo.getTagClassName();
      try {
          tagHandlerClass = ctxt.getClassLoader().loadClass(handlerClassName);
      } catch (Exception e) {
          err.jspError(start, "jsp.error.loadclass.taghandler",
           handlerClassName, tagName);
      }
  }

        // Parse 'CustomActionBody' production:
        // At this point we are committed - if anything fails, we produce
        // a translation error.

        // Parse 'Attributes' production:
  Attributes attrs = parseAttributes();
  reader.skipSpaces();
 
        // Parse 'CustomActionEnd' production:
  if (reader.matches("/>")) {
      if (tagInfo != null) {
    new Node.CustomTag(tagName, prefix, shortTagName, uri, attrs,
           start, parent, tagInfo, tagHandlerClass);
      } else {
    new Node.CustomTag(tagName, prefix, shortTagName, uri, attrs,
           start, parent, tagFileInfo);
      }
      return true;
  }
 
        // Now we parse one of 'CustomActionTagDependent',
        // 'CustomActionJSPContent', or 'CustomActionScriptlessContent'.
        // depending on body-content in TLD.

  // Looking for a body, it still can be empty; but if there is a
  // a tag body, its syntax would be dependent on the type of
  // body content declared in the TLD.
  String bc;
  if (tagInfo != null) {
      bc = tagInfo.getBodyContent();
  } else {
      bc = tagFileInfo.getTagInfo().getBodyContent();
  }

  Node tagNode = null;
  if (tagInfo != null) {
      tagNode = new Node.CustomTag(tagName, prefix, shortTagName, uri,
View Full Code Here

            return false;
        }

        TagLibraryInfo tagLibInfo = pageInfo.getTaglib(uri);
        TagInfo tagInfo = tagLibInfo.getTag(shortTagName);
        TagFileInfo tagFileInfo = tagLibInfo.getTagFile(shortTagName);
        if (tagInfo == null && tagFileInfo == null) {
            err.jspError(start, "jsp.error.bad_tag", shortTagName, prefix);
        }
        Class tagHandlerClass = null;
        if (tagInfo != null) {
            // Must be a classic tag, load it here.
            // tag files will be loaded later, in TagFileProcessor
            String handlerClassName = tagInfo.getTagClassName();
            try {
                tagHandlerClass =
                    ctxt.getClassLoader().loadClass(handlerClassName);
            } catch (Exception e) {
                err.jspError(start, "jsp.error.loadclass.taghandler",
                             handlerClassName, tagName);
            }
        }

        // Parse 'CustomActionBody' production:
        // At this point we are committed - if anything fails, we produce
        // a translation error.

        // Parse 'Attributes' production:
        Attributes attrs = parseAttributes();
        reader.skipSpaces();
       
        // Parse 'CustomActionEnd' production:
        if (reader.matches("/>")) {
            if (tagInfo != null) {
                new Node.CustomTag(tagName, prefix, shortTagName, uri, attrs,
                                   start, parent, tagInfo, tagHandlerClass);
            } else {
                new Node.CustomTag(tagName, prefix, shortTagName, uri, attrs,
                                   start, parent, tagFileInfo);
            }
            return true;
        }
       
        // Now we parse one of 'CustomActionTagDependent',
        // 'CustomActionJSPContent', or 'CustomActionScriptlessContent'.
        // depending on body-content in TLD.

        // Looking for a body, it still can be empty; but if there is a
        // a tag body, its syntax would be dependent on the type of
        // body content declared in the TLD.
        String bc;
        if (tagInfo != null) {
            bc = tagInfo.getBodyContent();
        } else {
            bc = tagFileInfo.getTagInfo().getBodyContent();
        }

        Node tagNode = null;
        if (tagInfo != null) {
            tagNode = new Node.CustomTag(tagName, prefix, shortTagName, uri,
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.tagext.TagFileInfo

Copyright © 2018 www.massapicom. 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.