public URL getResource(String res) throws MalformedURLException { URL result = null; if (res.startsWith("/META-INF/")) { // This is a tag file packaged in a jar that is being compiled URL jarUrl = tagFileJarUrls.get(res); if (jarUrl == null) { jarUrl = tagJar.getJarFileURL(); } if (jarUrl != null) { result = new URL(jarUrl.toExternalForm() + res.substring(1)); } else { // May not be in a JAR in some IDE environments result = context.getResource(canonicalURI(res)); } } else if (res.startsWith("jar:file:")) { // This is a tag file packaged in a jar that is being checked // for a dependency result = new URL(res); } else { result = context.getResource(canonicalURI(res)); } return result; }
protected TagFileInfo createTagFileInfo(org.apache.jasper.deploy.TagFileInfo tagFileInfo, Jar jar) 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, jar.getJarFileURL()); } else if (!path.startsWith("/WEB-INF/tags")) { err.jspError(MESSAGES.invalidTagFileDirectory(path)); } TagInfo tagInfo = TagFileProcessor.parseTagFileDirectives( parserController, name, path, jar, this); return new TagFileInfo(name, path, tagInfo); }
URL jarURL = jar.getJarFileURL(); try { jar.nextEntry();