Refine search
/** * Get the TagFileInfo for a given tag name, looking through all the * tag files in this tag library. * * @param shortname The short name (no prefix) of the tag * @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; } for (int i=0; i < tagFiles.length; i++) { if (tagFiles[i].getName().equals(shortname)) { return tagFiles[i]; } } return null; }
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] + "!" + tagFilePath); } else { pageInfo.addDependant(tagFilePath); } Class c = loadTagFile(compiler, tagFilePath, n.getTagInfo(), pageInfo); n.setTagHandlerClass(c); } visitBody(n); } }
TagInfo tagInfo = tagLibInfo.getTag(shortTagName); TagFileInfo tagFileInfo = tagLibInfo.getTagFile(shortTagName); if (tagInfo == null && tagFileInfo == null) { err.jspError(start, "jsp.error.bad_tag", shortTagName, prefix); String handlerClassName = tagInfo.getTagClassName(); try { tagHandlerClass = ctxt.getClassLoader().loadClass( handlerClassName); } catch (Exception e) { bc = tagInfo.getBodyContent(); } else { bc = tagFileInfo.getTagInfo().getBodyContent();
private static String getBodyType(Node.CustomTag custom) { if (custom.getTagInfo() != null) { return custom.getTagInfo().getBodyContent(); } return custom.getTagFileInfo().getTagInfo().getBodyContent(); }
public CustomTag(String jspVersion, String qName, String prefix, String localName, String uri, Attributes attrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent, TagFileInfo tagFileInfo) { super(qName, localName, attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent); this.jspVersion = Double.valueOf(jspVersion).doubleValue(); this.uri = uri; this.prefix = prefix; this.tagFileInfo = tagFileInfo; this.tagInfo = tagFileInfo.getTagInfo(); this.customNestingLevel = makeCustomNestingLevel(); this.childInfo = new ChildInfo(); this.implementsIterationTag = false; this.implementsBodyTag = false; this.implementsTryCatchFinally = false; this.implementsSimpleTag = true; this.implementsDynamicAttributes = tagInfo.hasDynamicAttributes(); }
/** * Checks to see if the given tag name maps to a tag file path, * and if so, parses the corresponding tag file. * * @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 = tagFileMap.get(shortName); if (path == null) { return null; } TagInfo tagInfo = null; try { tagInfo = TagFileProcessor.parseTagFileDirectives(pc, shortName, path, this); } catch (JasperException je) { throw new RuntimeException(je.toString()); } tagFile = new TagFileInfo(shortName, path, tagInfo); vec.add(tagFile); this.tagFiles = vec.toArray(new TagFileInfo[vec.size()]); } return tagFile; }
TagFileInfo tagFileInfo = n.getTagFileInfo(); if (tagFileInfo != null) { String tagFilePath = tagFileInfo.getPath(); if (tagFilePath.startsWith("/META-INF/")) { compiler.getCompilationContext().getTldResourcePath( tagFileInfo.getTagInfo().getTagLibrary().getURI()); } else { pageInfo.addDependant(tagFilePath, compiler.getCompilationContext().getLastModified(tagFilePath)); compiler.getCompilationContext().getLastModified(tagFilePath));
if (ctxt.getOptions().isCaching()) { impl = (TagLibraryInfoImpl) ctxt.getOptions() .getCache().get(uri); String[] location = ctxt.getTldLocation(uri); impl = new TagLibraryInfoImpl(ctxt, parserController, pageInfo, prefix, uri, location, err); ctxt.setTagFileJarUrl(info.getPath(), ctxt.getTagFileJarUrl(info.getPath()));
if (ctxt.getOptions().isCaching()) { impl = (TagLibraryInfoImpl) ctxt.getOptions() .getCache().get(uri); TldLocation location = ctxt.getTldLocation(uri); impl = new TagLibraryInfoImpl(ctxt, parserController, pageInfo, prefix, uri, location, err, ctxt.setTagFileJarResource(info.getPath(), ctxt.getTagFileJarResource());
ctxt.getTagFileJarUrls().put(path, jarFileUrl); } else if (!path.startsWith("/WEB-INF/tags")) { err.jspError("jsp.error.tagfile.illegalPath", path); = TagFileProcessor.parseTagFileDirectives(parserController, name, path, this); return new TagFileInfo(name, path, tagInfo);
TagFileInfo tagFile = super.getTagFile(shortName); if (tagFile == null) { String path = (String) tagFileMap.get(shortName); shortName, path, pc.getJspCompilationContext().getTagFileJarUrl(path), this); } catch (JasperException je) { tagFile = new TagFileInfo(shortName, path, tagInfo); vec.addElement(tagFile);
public TagFileInfo getTagFile(String shortName) { TagFileInfo tagFile = super.getTagFile(shortName); if (tagFile == null) { String path = tagFileMap.get(shortName); shortName, path, pc.getJspCompilationContext().getTagFileJarResource(path), this); } catch (JasperException je) { tagFile = new TagFileInfo(shortName, path, tagInfo); vec.addElement(tagFile);
protected TagFileInfo createTagFileInfo(org.apache.catalina.deploy.jsp.TagFileInfo tagFileInfo, URL jarFileUrl) throws JasperException { String name = tagFileInfo.getName(); String path = tagFileInfo.getPath(); if (path.startsWith("/META-INF/tags")) { // Tag file packaged in JAR // See https://issues.apache.org/bugzilla/show_bug.cgi?id=46471 // This needs to be removed once all the broken code that depends on // it has been removed ctxt.setTagFileJarUrl(path, jarFileUrl); } else if (!path.startsWith("/WEB-INF/tags")) { err.jspError("jsp.error.tagfile.illegalPath", path); } TagInfo tagInfo = TagFileProcessor.parseTagFileDirectives( parserController, name, path, jarFileUrl, this); return new TagFileInfo(name, path, tagInfo); }
private TagFileInfo createTagFileInfo(TagFileXml tagFileXml, Jar jar) throws JasperException { String name = tagFileXml.getName(); String path = tagFileXml.getPath(); if (path == null) { // path is required err.jspError("jsp.error.tagfile.missingPath"); } else if (!path.startsWith("/META-INF/tags") && !path.startsWith("/WEB-INF/tags")) { err.jspError("jsp.error.tagfile.illegalPath", path); } TagInfo tagInfo = TagFileProcessor.parseTagFileDirectives(parserController, name, path, jar, this); return new TagFileInfo(name, path, tagInfo); }
public void visit(Node.CustomTag n) throws JasperException { TagFileInfo tagFileInfo = n.getTagFileInfo(); if (tagFileInfo != null) { String tagFilePath = tagFileInfo.getPath(); JspCompilationContext ctxt = compiler.getCompilationContext(); if (ctxt.getTagFileJarUrls().get(tagFilePath) == null) { // Omit tag file dependency info on jar files for now. pageInfo.addDependant(tagFilePath); } Class c = loadTagFile(compiler, tagFilePath, n.getTagInfo(), pageInfo); n.setTagHandlerClass(c); } visitBody(n); } }
ctxt.setTagFileJarResource(path, jarResource); } else if (!path.startsWith("/WEB-INF/tags")) { err.jspError("jsp.error.tagfile.illegalPath", path); return new TagFileInfo(name, path, tagInfo);
/** * Returns the tag from the tag file. */ public TagFileInfo getTagFile(String shortname) { if (this.tagFiles == null) return null; for (int i = 0; i < this.tagFiles.length; i++) if (this.tagFiles[i].getName().equals(shortname)) return this.tagFiles[i]; return null; } }
public void visit(Node.CustomTag n) throws JasperException { TagFileInfo tagFileInfo = n.getTagFileInfo(); if (tagFileInfo != null) { String tagFilePath = tagFileInfo.getPath(); JspCompilationContext ctxt = compiler.getCompilationContext(); if (ctxt.getTagFileJarUrls().get(tagFilePath) == null) { // Omit tag file dependency info on jar files for now. pageInfo.addDependant(tagFilePath); } Class c = loadTagFile(compiler, tagFilePath, n.getTagInfo(), pageInfo); n.setTagHandlerClass(c); } visitBody(n); } }
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] + "!" + tagFilePath); } else { pageInfo.addDependant(tagFilePath); } Class c = loadTagFile(compiler, tagFilePath, n.getTagInfo(), pageInfo); n.setTagHandlerClass(c); } visitBody(n); } }
TagInfo tagInfo = tagLibInfo.getTag(shortTagName); TagFileInfo tagFileInfo = tagLibInfo.getTagFile(shortTagName); if (tagInfo == null && tagFileInfo == null) { err.jspError(start, "jsp.error.bad_tag", shortTagName, prefix); String handlerClassName = tagInfo.getTagClassName(); try { tagHandlerClass = ctxt.getClassLoader().loadClass( handlerClassName); } catch (Exception e) { bc = tagInfo.getBodyContent(); } else { bc = tagFileInfo.getTagInfo().getBodyContent();