Index: java/org/apache/catalina/core/StandardHost.java
===================================================================
--- java/org/apache/catalina/core/StandardHost.java (revision 1030602)
+++ java/org/apache/catalina/core/StandardHost.java (working copy)
@@ -20,9 +20,12 @@
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import java.util.WeakHashMap;
+import java.util.regex.Pattern;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -114,6 +117,18 @@
/**
+ * The ignored deploy paths for this Host.
+ */
+ private String deployIgnorePaths = "";
+
+
+ /**
+ * The ignored deploy path Patterns for this Host.
+ */
+ private ArrayList A comma-separated list of regular expressions of paths to
+ ignore for These regular expressions are relative to From a performance standpoint, a single regular expression using
+ alternation will be more efficient than separate regular expressions.
+ For example, See Automatic Application
+ Deployment for more information. Set to When using automatic deployment, the autoDeploy
and
+ deployOnStartup
. This allows you to keep your configuration
+ in a version control system, for example, and not deploy a .svn or CVS
+ folder that happens to be in appBase
.appBase
. They
+ are also anchored, meaning the match is performed against the
+ entire file/directory name. So, foo
matches only a file or
+ directory named foo
but not foo.war
,
+ foobar
, or myfooapp
. To match anything with
+ "foo", you would use something like .*foo.*
.deployIgnorePaths
set to
+ foo\.war|bar
has the same effect as
+ foo\.war,bar
, but the former is more efficient.false
if you want to disable parsing the context
XML descriptor embedded inside the application (located at
@@ -306,14 +327,15 @@
ROOT.xml
.
appBase
directory that has not already been deployed as a result of a context
- XML descriptor and does not have a corresponding directory of the same
- name (without the ".war" extension) will be deployed next. The context
- path used will be a slash character ("/") followed by the web
- application archive name less the ".war" extension. The one exception to
- this rule is that a web application archive named "ROOT.war" will be
- deployed with a context path of /
. Multi-level contexts may
- be defined by using #, e.g. use a WAR named foo#bar.war
for
- a context path of /foo/bar
.
+ XML descriptor, does not have a corresponding directory of the same
+ name (without the ".war" extension), and is not excluded by
+ deployIgnorePaths
will be deployed next. The context path
+ used will be a slash character ("/") followed by the web application
+ archive name less the ".war" extension. The one exception to this rule
+ is that a web application archive named "ROOT.war" will be deployed with
+ a context path of /
. Multi-level contexts may be defined by
+ using #, e.g. use a WAR named foo#bar.war
for a context
+ path of /foo/bar
.
If the unpackWARs
attribute is true
, the web
application archive file will be expanded to a directory of the same
name (without the ".war" extension".
@@ -333,11 +355,12 @@
appBase
that
has not already been deployed as a result of a context XML descriptor
- will be deployed. The context path used will be a slash character
- ("/") followed by the directory name, unless the directory name is ROOT,
- in which case the context path will /
. Multi-level contexts
- may be defined by using #, e.g. use a directory named
- foo#bar
for a context path of /foo/bar
.
+ and is not excluded by deployIgnorePaths
will be deployed.
+ The context path used will be a slash character ("/") followed by the
+ directory name, unless the directory name is ROOT, in which case the
+ context path will /
. Multi-level contexts may be defined by
+ using #, e.g. use a directory named foo#bar
for a context
+ path of /foo/bar
.
Any directory within the Hosts's appBase
directory that
does not have a corresponding context XML descriptor in
$CATALINA_BASE/conf/[engine_name]/[host_name]
will be
@@ -390,15 +413,16 @@
docBase
defined by
an XML Context file should be outside of the
- appBase
directory. If this is not the case difficulties
+ appBase
directory. If this is not the case, difficulties
may be experienced deploying the web application or the application may
- be deployed twice.deployIgnorePaths
attribute can be used
+ to avoid this situation.
Finally, note that if you are defining contexts explicitly in server.xml, - you should probably turn off automatic application deployment. Otherwise, - the web applications will each be deployed twice, and that may cause - problems for the applications. -
+ you should probably turn off automatic application deployment or specify +deployIgnorePaths
carefully. Otherwise, the web applications
+ will each be deployed twice, and that may cause problems for the
+ applications.