Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DCC6E91B5 for ; Fri, 2 Dec 2011 20:50:31 +0000 (UTC) Received: (qmail 78907 invoked by uid 500); 2 Dec 2011 20:50:30 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 78853 invoked by uid 500); 2 Dec 2011 20:50:30 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 78837 invoked by uid 99); 2 Dec 2011 20:50:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2011 20:50:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2011 20:50:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 25F3723889E0 for ; Fri, 2 Dec 2011 20:49:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1209686 [1/2] - in /tomcat/trunk: java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/startup/ java/org/apache/naming/resources/ test/org/apache/catalina/loader/ test/webapp-3.0-virtual-webapp/ test/web... Date: Fri, 02 Dec 2011 20:49:52 -0000 To: dev@tomcat.apache.org From: slaurent@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111202204954.25F3723889E0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: slaurent Date: Fri Dec 2 20:49:50 2011 New Revision: 1209686 URL: http://svn.apache.org/viewvc?rev=1209686&view=rev Log: bug 51741: Eclipse WTP "Serve modules without publishing" broken with tc7, needs patch in tomcat https://issues.apache.org/bugzilla/show_bug.cgi?id=51741 Added: tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java (with props) tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java (with props) tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/context.xml (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties (with props) tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc2/resourceJ.properties (with props) Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java tomcat/trunk/java/org/apache/naming/resources/VirtualDirContext.java tomcat/trunk/webapps/docs/config/context.xml tomcat/trunk/webapps/docs/config/resources.xml Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1209686&r1=1209685&r2=1209686&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Fri Dec 2 20:49:50 2011 @@ -1177,6 +1177,19 @@ public class StandardContext extends Con } } + /** + * Add a URL for a JAR that contains static resources in a + * META-INF/resources directory that should be included in the static + * resources for this context. + */ + public void addResourcesDirContext(DirContext altDirContext) { + if (webappResources instanceof BaseDirContext) { + ((BaseDirContext) webappResources).addAltDirContext(altDirContext); + } else { + log.error(sm.getString("standardContext.noResourceJar", altDirContext, + getName())); + } + } /** * Set the current alias configuration. The list of aliases should be of the Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1209686&r1=1209685&r2=1209686&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Fri Dec 2 20:49:50 2011 @@ -46,11 +46,11 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.ResourceBundle; import java.util.Set; -import java.util.Vector; import java.util.concurrent.ThreadPoolExecutor; import java.util.jar.Attributes; import java.util.jar.Attributes.Name; @@ -1278,7 +1278,8 @@ public class WebappClassLoader if (log.isDebugEnabled()) log.debug(" findResources(" + name + ")"); - Vector result = new Vector(); + //we use a LinkedHashSet instead of a Vector to avoid duplicates with virtualmappings + LinkedHashSet result = new LinkedHashSet(); int jarFilesLength = jarFiles.length; int repositoriesLength = repositories.length; @@ -1291,7 +1292,7 @@ public class WebappClassLoader Enumeration otherResourcePaths = super.findResources(name); while (otherResourcePaths.hasMoreElements()) { - result.addElement(otherResourcePaths.nextElement()); + result.add(otherResourcePaths.nextElement()); } } @@ -1303,7 +1304,7 @@ public class WebappClassLoader // Note : Not getting an exception here means the resource was // found try { - result.addElement(getURI(new File(files[i], name))); + result.add(getURI(new File(files[i], name))); } catch (MalformedURLException e) { // Ignore } @@ -1321,7 +1322,7 @@ public class WebappClassLoader try { String jarFakeUrl = getURI(jarRealFiles[i]).toString(); jarFakeUrl = "jar:" + jarFakeUrl + "!/" + name; - result.addElement(new URL(jarFakeUrl)); + result.add(new URL(jarFakeUrl)); } catch (MalformedURLException e) { // Ignore } @@ -1336,12 +1337,24 @@ public class WebappClassLoader Enumeration otherResourcePaths = super.findResources(name); while (otherResourcePaths.hasMoreElements()) { - result.addElement(otherResourcePaths.nextElement()); + result.add(otherResourcePaths.nextElement()); } } + + final Iterator iterator = result.iterator(); - return result.elements(); + return new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public URL nextElement() { + return iterator.next(); + } + }; } Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1209686&r1=1209685&r2=1209686&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Dec 2 20:49:50 2011 @@ -46,6 +46,9 @@ import java.util.Properties; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import javax.naming.Binding; +import javax.naming.NamingEnumeration; +import javax.naming.NamingException; import javax.servlet.ServletContainerInitializer; import javax.servlet.ServletContext; import javax.servlet.annotation.HandlesTypes; @@ -79,6 +82,7 @@ import org.apache.catalina.util.ContextN import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.naming.resources.DirContextURLConnection; +import org.apache.naming.resources.FileDirContext; import org.apache.naming.resources.ResourceAttributes; import org.apache.tomcat.JarScanner; import org.apache.tomcat.JarScannerCallback; @@ -1197,14 +1201,21 @@ public class ContextConfig // Step 4. Process /WEB-INF/classes for annotations // This will add any matching classes to the typeInitializerMap if (ok) { - URL webinfClasses; try { - webinfClasses = context.getServletContext().getResource( - "/WEB-INF/classes"); - processAnnotationsUrl(webinfClasses, webXml); - } catch (MalformedURLException e) { + NamingEnumeration listBindings = + context.getResources().listBindings("/WEB-INF/classes"); + while (listBindings.hasMoreElements()) { + Binding binding = listBindings.nextElement(); + if (binding.getObject() instanceof FileDirContext) { + File webInfCLassDir = + new File( + ((FileDirContext) binding.getObject()).getDocBase()); + processAnnotationsFile(webInfCLassDir, webXml); + } + } + } catch (NamingException e) { log.error(sm.getString( - "contextConfig.webinfClassesUrl"), e); + "contextConfig.webinfClassesUrl"), e); } } @@ -1567,10 +1578,25 @@ public class ContextConfig if (jar.entryExists("META-INF/resources/")) { context.addResourceJarUrl(url); } + } else if ("file".equals(url.getProtocol())) { + FileDirContext fileDirContext = new FileDirContext(); + fileDirContext.setDocBase(new File(url.toURI()).getAbsolutePath()); + try { + fileDirContext.lookup("META-INF/resources/"); + //lookup succeeded + if(context instanceof StandardContext){ + ((StandardContext)context).addResourcesDirContext(fileDirContext); + } + } catch (NamingException e) { + //not found, ignore + } } } catch (IOException ioe) { log.error(sm.getString("contextConfig.resourceJarFail", url, context.getName())); + } catch (URISyntaxException e) { + log.error(sm.getString("contextConfig.resourceJarFail", url, + context.getName())); } finally { if (jar != null) { jar.close(); Modified: tomcat/trunk/java/org/apache/naming/resources/VirtualDirContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/VirtualDirContext.java?rev=1209686&r1=1209685&r2=1209686&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/resources/VirtualDirContext.java (original) +++ tomcat/trunk/java/org/apache/naming/resources/VirtualDirContext.java Fri Dec 2 20:49:50 2011 @@ -18,70 +18,69 @@ package org.apache.naming.resources; import java.io.File; import java.util.ArrayList; -import java.util.Hashtable; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.StringTokenizer; import javax.naming.NamingException; import javax.naming.directory.Attributes; +import org.apache.catalina.loader.VirtualWebappLoader; import org.apache.naming.NamingEntry; /** - * Extended FileDirContext implementation that will allow loading of tld files - * from the META-INF directory (or subdirectories) in classpath. This will fully - * mimic the behavior of compressed jars also when using unjarred resources. Tld - * files can be loaded indifferently from WEB-INF webapp dir (or subdirs) or - * from META-INF dir from jars available in the classpath: using this DirContext - * implementation you will be able to use unexpanded jars during development and - * to make any tld in them virtually available to the webapp. - * + * Extended FileDirContext implementation that allows to expose multiple + * directories of the filesystem under a single webapp, a feature mainly used + * for development with IDEs. + * This should be used in conjunction with {@link VirtualWebappLoader}. + * * Sample context xml configuration: - * + * * - * <Context docBase="\webapps\mydocbase"> + * <Context path="/mywebapp" docBase="/Users/theuser/mywebapp/src/main/webapp" > * <Resources className="org.apache.naming.resources.VirtualDirContext" - * virtualClasspath="\dir\classes;\somedir\somejar.jar"/> - * </Resources> + * extraResourcePaths="/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies" /> + * <Loader className="org.apache.catalina.loader.VirtualWebappLoader" + * virtualClasspath="/Users/theuser/mywebapp/target/classes" /> + * <JarScanner scanAllDirectories="true" /> + * </Context> * - * - * + * + * * This is not meant to be used for production. * Its meant to ease development with IDE's without the * need for fully republishing jars in WEB-INF/lib - * - * + * + * * @author Fabrizio Giustina * @version $Id$ */ public class VirtualDirContext extends FileDirContext { + private String extraResourcePaths = ""; + private Map> mappedResourcePaths; /** - * Map containing generated virtual names for tld files under WEB-INF and - * the actual file reference. + *

+ * Allows to map a path of the filesystem to a path in the webapp. Multiple + * filesystem paths can be mapped to the same path in the webapp. Filesystem + * path and virtual path must be separated by an equal sign. Pairs of paths + * must be separated by a comma. + *

+ * Example: + * /=/Users/slaurent/mywebapp/src/main/webapp;/pictures=/Users/slaurent/sharedpictures + * + *

+ * The path to the docBase must not be added here, otherwise resources would + * be listed twice. + *

+ * + * @param path */ - private Map virtualMappings; - - /** - * Map containing a mapping for tag files that should be loaded from the - * META-INF dir of referenced jar files. - */ - private Map tagfileMappings; - - /** - * ; separated list of virtual path elements. - */ - private String virtualClasspath; - - /** - * virtualClasspath attribute that will be automatically set - * from the Context virtualClasspath attribute - * from the context xml file. - * @param path ; separated list of path elements. - */ - public void setVirtualClasspath(String path) { - virtualClasspath = path; + public void setExtraResourcePaths(String path) { + extraResourcePaths = path; } /** @@ -91,19 +90,39 @@ public class VirtualDirContext extends F public void allocate() { super.allocate(); - virtualMappings = new Hashtable(); - tagfileMappings = new Hashtable(); - - // looks into any META-INF dir found in classpath entries for tld files. - StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); + mappedResourcePaths = new HashMap>(); + StringTokenizer tkn = new StringTokenizer(extraResourcePaths, ","); while (tkn.hasMoreTokens()) { - File file = new File(tkn.nextToken(), "META-INF"); + String resSpec = tkn.nextToken(); + if (resSpec.length() > 0) { + int idx = resSpec.indexOf('='); + String path; + if (idx <= 0) { + path = ""; + } + else { + if (resSpec.startsWith("/=")) { + resSpec = resSpec.substring(1); + idx--; + } + path = resSpec.substring(0, idx); + } + String dir = resSpec.substring(idx + 1); + List resourcePaths = mappedResourcePaths.get(path); + if (resourcePaths == null) { + resourcePaths = new ArrayList(); + mappedResourcePaths.put(path, resourcePaths); + } + resourcePaths.add(dir); - if (!file.exists() || !file.isDirectory()) { - continue; + // Set allowLinking since there can be no canonical path + setAllowLinking(true); } - scanForTlds(file); } + if (mappedResourcePaths.isEmpty()) { + mappedResourcePaths = null; + } + } /** @@ -111,48 +130,124 @@ public class VirtualDirContext extends F */ @Override public void release() { + mappedResourcePaths = null; + super.release(); - virtualMappings = null; } @Override public Attributes getAttributes(String name) throws NamingException { - // handle "virtual" tlds - if (name.startsWith("/WEB-INF/") && name.endsWith(".tld")) { - String tldName = name.substring(name.lastIndexOf("/") + 1); - if (virtualMappings.containsKey(tldName)) { - return new FileResourceAttributes(virtualMappings.get(tldName)); - } - } else if (name.startsWith("/META-INF/tags") && name.endsWith(".tag") - || name.endsWith(".tagx")) { + NamingException initialException; + try { + // first try the normal processing, if it fails try with extra + // resources + Attributes attributes = super.getAttributes(name); + return attributes; + } catch (NamingException exc) { + initialException = exc; + } - // already loaded tag file - if (tagfileMappings.containsKey(name)) { - return new FileResourceAttributes(tagfileMappings.get(name)); + if (mappedResourcePaths != null) { + for (Map.Entry> mapping : mappedResourcePaths.entrySet()) { + String path = mapping.getKey(); + List dirList = mapping.getValue(); + String resourcesDir = dirList.get(0); + if (name.equals(path)) { + File f = new File(resourcesDir); + if (f.exists() && f.canRead()) { + return new FileResourceAttributes(f); + } + } + path += "/"; + if (name.startsWith(path)) { + String res = name.substring(path.length()); + File f = new File(resourcesDir + "/" + res); + if (f.exists() && f.canRead()) { + return new FileResourceAttributes(f); + } + } } + } + throw initialException; + } - // unknown tagfile, search for it in virtualClasspath - StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); - while (tkn.hasMoreTokens()) { - File file = new File(tkn.nextToken(), name); - if (file.exists()) { - tagfileMappings.put(name, file); - return new FileResourceAttributes(file); + @Override + protected File file(String name) { + File file = super.file(name); + if (file != null || mappedResourcePaths == null) { + return file; + } + // If not found under docBase, try our other resources + // Ensure name string begins with a slash + if (name.length() > 0 && name.charAt(0) != '/') { + name = "/" + name; + } + for (Map.Entry> mapping : mappedResourcePaths.entrySet()) { + String path = mapping.getKey(); + List dirList = mapping.getValue(); + if (name.equals(path)) { + for (String resourcesDir : dirList) { + file = new File(resourcesDir); + if (file.exists() && file.canRead()) { + return file; + } + } + } + if (name.startsWith(path + "/")) { + String res = name.substring(path.length()); + for (String resourcesDir : dirList) { + file = new File(resourcesDir, res); + if (file.exists() && file.canRead()) { + return file; + } } } } - - return super.getAttributes(name); + return null; } @Override protected List list(File file) { List entries = super.list(file); - // adds virtual tlds for WEB-INF listing - if ("WEB-INF".equals(file.getName())) { - entries.addAll(getVirtualNamingEntries()); + if (mappedResourcePaths != null && !mappedResourcePaths.isEmpty()) { + Set entryNames = new HashSet(entries.size()); + for (NamingEntry entry : entries) { + entryNames.add(entry.name); + } + // Add appropriate entries from the extra resource paths + String absPath = file.getAbsolutePath(); + if (absPath.startsWith(getDocBase() + File.separator)) { + String relPath = absPath.substring(getDocBase().length()); + String fsRelPath = relPath.replace(File.separatorChar, '/'); + for (Map.Entry> mapping : mappedResourcePaths.entrySet()) { + String path = mapping.getKey(); + List dirList = mapping.getValue(); + String res = null; + if (fsRelPath.equals(path)) { + res = ""; + } else if (fsRelPath.startsWith(path + "/")) { + res = relPath.substring(path.length()); + } + if (res != null) { + for (String resourcesDir : dirList) { + File f = new File(resourcesDir, res); + if (f.exists() && f.canRead() && f.isDirectory()) { + List virtEntries = super.list(f); + for (NamingEntry entry : virtEntries) { + // filter duplicate + if (!entryNames.contains(entry.name)) { + entryNames.add(entry.name); + entries.add(entry); + } + } + + } + } + } + } + } } return entries; @@ -161,65 +256,47 @@ public class VirtualDirContext extends F @Override protected Object doLookup(String name) { - // handle "virtual" tlds - if (name.startsWith("/WEB-INF/") && name.endsWith(".tld")) { - String tldName = name.substring(name.lastIndexOf("/") + 1); - if (virtualMappings.containsKey(tldName)) { - return new FileResource(virtualMappings.get(tldName)); - } - } else if (name.startsWith("/META-INF/tags") && name.endsWith(".tag") - || name.endsWith(".tagx")) { - - // already loaded tag file: we are sure that getAttributes() has - // already been called if we are here - File tagFile = tagfileMappings.get(name); - if (tagFile != null) { - return new FileResource(tagFile); - } + Object retSuper = super.doLookup(name); + if (retSuper != null || mappedResourcePaths == null) { + return retSuper; } - return super.doLookup(name); - } - - /** - * Scan a given dir for tld files. Any found tld will be added to the - * virtualMappings. - * @param dir Dir to scan for tlds - */ - private void scanForTlds(File dir) { - - File[] files = dir.listFiles(); - for (int j = 0; j < files.length; j++) { - File file = files[j]; - - if (file.isDirectory()) { - scanForTlds(file); - } else if (file.getName().endsWith(".tld")) { - // just generate a random name using the current timestamp, name - // doesn't matter since it needs to be referenced by URI - String virtualTldName = "~" + System.currentTimeMillis() + "~" - + file.getName(); - virtualMappings.put(virtualTldName, file); + // Perform lookup using the extra resource paths + for (Map.Entry> mapping : mappedResourcePaths.entrySet()) { + String path = mapping.getKey(); + List dirList = mapping.getValue(); + if (name.equals(path)) { + for (String resourcesDir : dirList) { + File f = new File(resourcesDir); + if (f.exists() && f.canRead()) { + if (f.isFile()) { + return new FileResource(f); + } + else { + // never goes here, if f is a directory the super + // implementation already returned a value + } + } + } + } + path += "/"; + if (name.startsWith(path)) { + String res = name.substring(path.length()); + for (String resourcesDir : dirList) { + File f = new File(resourcesDir + "/" + res); + if (f.exists() && f.canRead()) { + if (f.isFile()) { + return new FileResource(f); + } + else { + // never goes here, if f is a directory the super + // implementation already returned a value + } + } + } } } - - } - - /** - * Returns a list of virtual naming entries. - * @return list of naming entries, containing tlds in virtualMappings - */ - private List getVirtualNamingEntries() { - List virtual = new ArrayList(); - - for (String name : virtualMappings.keySet()) { - - File file = virtualMappings.get(name); - NamingEntry entry = new NamingEntry(name, new FileResource(file), - NamingEntry.ENTRY); - virtual.add(entry); - } - return virtual; + return retSuper; } } Added: tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java (added) +++ tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java Fri Dec 2 20:49:50 2011 @@ -0,0 +1,30 @@ +package org.apache.catalina.loader; + +import java.io.IOException; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +public class EchoTag extends TagSupport { + private static final long serialVersionUID = 1L; + + private String echo = null; + + public void setEcho(String echo) { + this.echo = echo; + } + + public String getEcho() { + return echo; + } + + @Override + public int doStartTag() throws JspException { + try { + pageContext.getOut().print("

" + echo + "

"); + } catch (IOException e) { + throw new JspException(e); + } + return super.doStartTag(); + } +} Propchange: tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/test/org/apache/catalina/loader/EchoTag.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java (added) +++ tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java Fri Dec 2 20:49:50 2011 @@ -0,0 +1,24 @@ +package org.apache.catalina.loader; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@WebServlet(value = "/annotatedServlet") +public class MyAnnotatedServlet extends HttpServlet { + + static final String MESSAGE = "This is generated by an annotated servlet"; + private static final long serialVersionUID = 1L; + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + resp.setContentType("test/plain"); + resp.getWriter().println(MESSAGE); + } + +} Propchange: tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/test/org/apache/catalina/loader/MyAnnotatedServlet.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java (added) +++ tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java Fri Dec 2 20:49:50 2011 @@ -0,0 +1,303 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.catalina.loader; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.HashSet; + +import junit.framework.Assert; + +import org.apache.catalina.core.JreMemoryLeakPreventionListener; +import org.apache.catalina.core.StandardContext; +import org.apache.catalina.startup.Tomcat; +import org.apache.catalina.startup.TomcatBaseTest; +import org.apache.naming.resources.VirtualDirContext; +import org.apache.tomcat.util.buf.ByteChunk; +import org.apache.tomcat.util.http.fileupload.FileUtils; +import org.apache.tomcat.util.http.fileupload.IOUtils; +import org.apache.tomcat.util.scan.StandardJarScanner; +import org.junit.Test; + +public class TestVirtualContext extends TomcatBaseTest { + + @Override + public void setUp() throws Exception { + super.setUp(); + + Tomcat tomcat = getTomcatInstance(); + + // BZ 49218: The test fails if JreMemoryLeakPreventionListener is not + // present. The listener affects the JVM, and thus not only the current, + // but also the subsequent tests that are run in the same JVM. So it is + // fair to add it in every test. + tomcat.getServer().addLifecycleListener( + new JreMemoryLeakPreventionListener()); + } + + @Test + public void testVirtualClassLoader() throws Exception { + Tomcat tomcat = getTomcatInstance(); + + File appDir = new File("test/webapp-3.0-virtual-webapp/src/main/webapp"); + // app dir is relative to server home + StandardContext ctx = (StandardContext) tomcat.addWebapp(null, "/test", + appDir.getAbsolutePath()); + + VirtualWebappLoader loader = new VirtualWebappLoader(ctx.getParentClassLoader()); + loader.setVirtualClasspath(// + "test/webapp-3.0-virtual-webapp/target/classes;" + // + "test/webapp-3.0-virtual-library/target/classes;" + // + "test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes;" + // + "test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes"); + ctx.setLoader(loader); + + String extraMappings = "/=test/webapp-3.0-virtual-webapp/src/main/webapp2" + // + ",/other=test/webapp-3.0-virtual-webapp/src/main/misc" + // + ",/WEB-INF/classes=test/webapp-3.0-virtual-webapp/target/classes"; + VirtualDirContext resources = new VirtualDirContext(); + resources.setExtraResourcePaths(extraMappings); + ctx.setResources(resources); + + StandardJarScanner jarScanner = new StandardJarScanner(); + jarScanner.setScanAllDirectories(true); + ctx.setJarScanner(jarScanner); + + tomcat.start(); + + assertPageContains("/test/classpathGetResourceAsStream.jsp?path=nonexistent", + "resourceAInWebInfClasses=true", 404); + + assertPageContains( + "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceA.properties", + "resourceAInWebInfClasses=true"); + assertPageContains( + "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceA.properties", + "resourceAInWebInfClasses=true"); + + assertPageContains( + "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceB.properties", + "resourceBInTargetClasses=true"); + assertPageContains( + "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceB.properties", + "resourceBInTargetClasses=true"); + + assertPageContains( + "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceC.properties", + "resourceCInDependentLibraryTargetClasses=true"); + assertPageContains( + "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceC.properties", + "resourceCInDependentLibraryTargetClasses=true"); + + assertPageContains( + "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceD.properties", + "resourceDInPackagedJarInWebInfLib=true"); + assertPageContains( + "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceD.properties", + "resourceDInPackagedJarInWebInfLib=true"); + + assertPageContains( + "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceG.properties", + "resourceGInWebInfClasses=true"); + assertPageContains( + "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceG.properties", + "resourceGInWebInfClasses=true"); + + // test listing all possible paths for a classpath resource + String allUrls = + getUrl( + "http://localhost:" + getPort() + + "/test/classpathGetResources.jsp?path=rsrc/").toString(); + assertTrue( + allUrls, + allUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc") > 0); + assertTrue( + allUrls, + allUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc") > 0); + assertTrue( + allUrls, + allUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar!/rsrc") > 0); + assertTrue( + allUrls, + allUrls.indexOf("/test/webapp-3.0-virtual-webapp/target/classes/rsrc") > 0); + assertTrue( + allUrls, + allUrls.indexOf("/test/webapp-3.0-virtual-library/target/classes/rsrc") > 0); + + // check that there's no duplicate in the URLs + String[] allUrlsArray = allUrls.split("\\s+"); + Assert.assertEquals(new HashSet(Arrays.asList(allUrlsArray)).size(), + allUrlsArray.length); + + String allRsrsc2ClasspathUrls = + getUrl( + "http://localhost:" + getPort() + + "/test/classpathGetResources.jsp?path=rsrc2/").toString(); + assertTrue( + allRsrsc2ClasspathUrls, + allRsrsc2ClasspathUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2") > 0); + + // tests context.getRealPath + + // the following fails because getRealPath always return a non-null path + // even if there's no such resource + // assertPageContains("/test/contextGetRealPath.jsp?path=nonexistent", + // "resourceAInWebInfClasses=true", 404); + assertPageContains( + "/test/contextGetRealPath.jsp?path=/rsrc/resourceF.properties", + "/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties"); + + // tests context.getResource then the content + + assertPageContains("/test/contextGetResource.jsp?path=nonexistent", + "resourceAInWebInfClasses=true", 404); + assertPageContains( + "/test/contextGetResource.jsp?path=/WEB-INF/classes/rsrc/resourceA.properties", + "resourceAInWebInfClasses=true"); + assertPageContains( + "/test/contextGetResource.jsp?path=/WEB-INF/classes/rsrc/resourceG.properties", + "resourceGInWebInfClasses=true"); + assertPageContains( + "/test/contextGetResource.jsp?path=/rsrc/resourceE.properties", + "resourceEInDependentLibraryTargetClasses=true"); + assertPageContains( + "/test/contextGetResource.jsp?path=/other/resourceI.properties", + "resourceIInWebapp=true"); + assertPageContains( + "/test/contextGetResource.jsp?path=/rsrc2/resourceJ.properties", + "resourceJInWebapp=true"); + + String allRsrcPaths = + getUrl( + "http://localhost:" + getPort() + + "/test/contextGetResourcePaths.jsp?path=/rsrc/").toString(); + assertTrue( + allRsrcPaths, + allRsrcPaths.indexOf("/rsrc/resourceF.properties") > 0); + assertTrue( + allRsrcPaths, + allRsrcPaths.indexOf("/rsrc/resourceE.properties") > 0); + assertTrue( + allRsrcPaths, + allRsrcPaths.indexOf("/rsrc/resourceH.properties") > 0); + + // check that there's no duplicate in the URLs + String[] allRsrcPathsArray = allRsrcPaths.split("\\s+"); + Assert.assertEquals(new HashSet(Arrays.asList(allRsrcPathsArray)).size(), + allRsrcPathsArray.length); + + String allRsrc2Paths = + getUrl( + "http://localhost:" + getPort() + + "/test/contextGetResourcePaths.jsp?path=/rsrc2/").toString(); + assertTrue( + allRsrc2Paths, + allRsrc2Paths.indexOf("/rsrc2/resourceJ.properties") > 0); + + assertPageContains( + "/test/testTlds.jsp", + "worldA"); + assertPageContains( + "/test/testTlds.jsp", + "worldB"); + assertPageContains( + "/test/testTlds.jsp", + "worldC"); + assertPageContains( + "/test/testTlds.jsp", + "worldD"); + } + + @Test + public void testAdditionalWebInfClassesPaths() throws Exception { + Tomcat tomcat = getTomcatInstance(); + + File appDir = new File("test/webapp-3.0-virtual-webapp/src/main/webapp"); + // app dir is relative to server home + StandardContext ctx = (StandardContext) tomcat.addWebapp(null, "/test", + appDir.getAbsolutePath()); + File tempFile = File.createTempFile("virtualWebInfClasses", null); + + File additionWebInfClasses = new File(tempFile.getAbsolutePath() + ".dir"); + Assert.assertTrue(additionWebInfClasses.mkdirs()); + File targetPackageForAnnotatedClass = + new File(additionWebInfClasses, + MyAnnotatedServlet.class.getPackage().getName().replace('.', '/')); + Assert.assertTrue(targetPackageForAnnotatedClass.mkdirs()); + InputStream annotatedServletClassInputStream = + this.getClass().getResourceAsStream( + MyAnnotatedServlet.class.getSimpleName() + ".class"); + FileOutputStream annotatedServletClassOutputStream = + new FileOutputStream(new File(targetPackageForAnnotatedClass, + MyAnnotatedServlet.class.getSimpleName() + ".class")); + IOUtils.copy(annotatedServletClassInputStream, annotatedServletClassOutputStream); + annotatedServletClassInputStream.close(); + annotatedServletClassOutputStream.close(); + + VirtualWebappLoader loader = new VirtualWebappLoader(ctx.getParentClassLoader()); + loader.setVirtualClasspath("test/webapp-3.0-virtual-webapp/target/classes;" + // + "test/webapp-3.0-virtual-library/target/classes;" + // + additionWebInfClasses.getAbsolutePath()); + ctx.setLoader(loader); + + tomcat.start(); + // first test that without the setting on StandardContext the annotated + // servlet is not detected + assertPageContains("/test/annotatedServlet", MyAnnotatedServlet.MESSAGE, 404); + + tomcat.stop(); + + // then test that if we configure StandardContext with the additional + // path, the servlet is detected + // ctx.setAdditionalVirtualWebInfClasses(additionWebInfClasses.getAbsolutePath()); + VirtualDirContext resources = new VirtualDirContext(); + resources.setExtraResourcePaths("/WEB-INF/classes=" + additionWebInfClasses); + ctx.setResources(resources); + + tomcat.start(); + assertPageContains("/test/annotatedServlet", MyAnnotatedServlet.MESSAGE); + tomcat.stop(); + FileUtils.deleteDirectory(additionWebInfClasses); + tempFile.delete(); + } + + private void assertPageContains(String pageUrl, String expectedBody) + throws IOException { + + assertPageContains(pageUrl, expectedBody, 200); + } + + private void assertPageContains(String pageUrl, String expectedBody, + int expectedStatus) throws IOException { + ByteChunk res = new ByteChunk(); + int sc = getUrl("http://localhost:" + getPort() + pageUrl, res, null); + + assertEquals(expectedStatus, sc); + + if (expectedStatus == 200) { + String result = res.toString(); + assertTrue(result, result.indexOf(expectedBody) >= 0); + } + } +} Propchange: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualContext.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld Fri Dec 2 20:49:50 2011 @@ -0,0 +1,37 @@ + + + 1.0 + B + http://tomcat.apache.org/B + + + Echo + org.apache.jasper.compiler.TestValidator$Echo + empty + + echo + yes + true + + + + \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/META-INF/B.tld ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceDInPackagedJarInWebInfLib=true Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/lib/rsrc/resourceD.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceIInWebapp=true Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/misc/resourceI.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/context.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/context.xml?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/context.xml (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/context.xml Fri Dec 2 20:49:50 2011 @@ -0,0 +1,18 @@ + + + + + + + + Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/META-INF/context.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld Fri Dec 2 20:49:50 2011 @@ -0,0 +1,37 @@ + + + 1.0 + A + http://tomcat.apache.org/A + + + Echo + org.apache.jasper.compiler.TestValidator$Echo + empty + + echo + yes + true + + + + \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/A.tld ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceAInWebInfClasses=true Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc/resourceA.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar?rev=1209686&view=auto ============================================================================== Files tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar (added) and tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar Fri Dec 2 20:49:50 2011 differ Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml Fri Dec 2 20:49:50 2011 @@ -0,0 +1,24 @@ + + + + \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp Fri Dec 2 20:49:50 2011 @@ -0,0 +1,32 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<% +response.setContentType("text/plain"); +String path = request.getParameter("path"); +if(path.startsWith("/")) path = path.substring(1); +java.io.InputStream is = this.getClass().getClassLoader().getResourceAsStream(path); +if(is==null) { + response.setStatus(404); + response.getWriter().println(path+ " not found in classpath"); + return; +} +int b; +while((b=is.read()) != -1){ + out.write(b); +} +%> \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceAsStream.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp Fri Dec 2 20:49:50 2011 @@ -0,0 +1,33 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<% +response.setContentType("text/plain"); +String path = request.getParameter("path"); +if(path.startsWith("/")) path = path.substring(1); +java.net.URL url = this.getClass().getClassLoader().getResource(path); +if(url==null) { + response.setStatus(404); + response.getWriter().println(path+ " not found in classpath"); + return; +} +java.io.InputStream is = url.openStream(); +int b; +while((b=is.read()) != -1){ + out.write(b); +} +%> \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResourceUrlThenGetStream.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp Fri Dec 2 20:49:50 2011 @@ -0,0 +1,25 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%><% +response.setContentType("text/plain"); +String path = request.getParameter("path"); +if(path.startsWith("/")) path = path.substring(1); +java.util.Enumeration e = this.getClass().getClassLoader().getResources(path); +while(e.hasMoreElements()){ + java.net.URL url = e.nextElement(); + out.println(url); +} +%> \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/classpathGetResources.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp Fri Dec 2 20:49:50 2011 @@ -0,0 +1,28 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<% +response.setContentType("text/plain"); +String path = request.getParameter("path"); +String realPath = application.getRealPath(path); +if(realPath==null) { + response.setStatus(404); + response.getWriter().println(path+ " cannot find real path"); + return; +} +response.getWriter().println(realPath); +%> \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetRealPath.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp Fri Dec 2 20:49:50 2011 @@ -0,0 +1,36 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<% +response.setContentType("text/plain"); +String path = request.getParameter("path"); +java.net.URL url = application.getResource(path); +if(url==null) { + response.setStatus(404); + response.getWriter().println(path+ " not found as context resource"); + return; +} +java.io.InputStream is = url.openStream(); +try { + int b; + while((b=is.read()) != -1){ + out.write(b); + } +} finally { + is.close(); +} +%> \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResource.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp Fri Dec 2 20:49:50 2011 @@ -0,0 +1,27 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<% +response.setContentType("text/plain"); +String path = request.getParameter("path"); +java.util.Set paths = application.getResourcePaths(path); +if(paths!=null){ + for(String p : paths) { + out.println(p); + } +} +%> \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/contextGetResourcePaths.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceFInWebapp=true Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp Fri Dec 2 20:49:50 2011 @@ -0,0 +1,26 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<%@ taglib prefix="A" uri="http://tomcat.apache.org/A" %> +<%@ taglib prefix="B" uri="http://tomcat.apache.org/B" %> +<%@ taglib prefix="C" uri="http://tomcat.apache.org/C" %> +<%@ taglib prefix="D" uri="http://tomcat.apache.org/D" %> + + + + + \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp/testTlds.jsp ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld Fri Dec 2 20:49:50 2011 @@ -0,0 +1,37 @@ + + + 1.0 + D + http://tomcat.apache.org/D + + + Echo + org.apache.jasper.compiler.TestValidator$Echo + empty + + echo + yes + true + + + + \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/D.tld ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceGInWebInfClasses=true Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc/resourceG.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceKInWebInfClasses=true Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2/resourceK.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +This file should not be served, it is masked by +/test/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties \ No newline at end of file Propchange: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceF.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties?rev=1209686&view=auto ============================================================================== --- tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties (added) +++ tomcat/trunk/test/webapp-3.0-virtual-webapp/src/main/webapp2/rsrc/resourceH.properties Fri Dec 2 20:49:50 2011 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resourceHInWebapp=true --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org