Index: java/org/apache/catalina/core/StandardHost.java
===================================================================
--- java/org/apache/catalina/core/StandardHost.java (revision 1030113)
+++ java/org/apache/catalina/core/StandardHost.java (working copy)
@@ -18,10 +18,13 @@
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import java.util.WeakHashMap;
+import java.util.regex.Pattern;
import org.apache.catalina.Container;
import org.apache.catalina.Context;
@@ -110,6 +113,18 @@
/**
+ * The ignored deploy paths for this Host.
+ */
+ private String deployIgnorePaths = "";
+
+
+ /**
+ * The ignored deploy path Patterns for this Host.
+ */
+ private ArrayListfalse
, this attribute will have no effect.
A comma-separated list of regular expressions of paths to
+ ignore for 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
.
These regular expressions are relative to 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.*
.
From a performance standpoint, a single regular expression using
+ alternation will be more efficient than separate regular expressions.
+ For example, deployIgnorePaths
set to
+ foo\.war|bar
has the same effect as
+ foo\.war,bar
, but the former is more efficient.
See Automatic Application + Deployment for more information.
+Set to false
if you want to disable parsing the context
XML descriptor embedded inside the application (located at
@@ -337,14 +358,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
.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
.unpackWARs
attribute is true
, the web
application archive file will be expanded to a directory of the same
name (without the ".war" extension".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
.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
.copyXml
is true
(it is false
by default), any directory within the Hosts's appBase
directory that does not have a corresponding context XML descriptor in
@@ -420,15 +443,16 @@
When using automatic deployment, the 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.