- add a little to the docs
- disallow an alias for "/"
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@937264
13f79535-47bb-0310-9956-
ffa450edef68
public abstract class BaseDirContext implements DirContext {
+ private static final org.apache.juli.logging.Log log=
+ org.apache.juli.logging.LogFactory.getLog( BaseDirContext.class );
// -------------------------------------------------------------- Constants
throw new IllegalArgumentException(
sm.getString("resources.invalidAliasMapping", kvp));
+ if (kv[0].equals("/")) {
+ throw new IllegalArgumentException(
+ sm.getString("resources.invalidAliasNotAllowed", kv[0]));
+ }
File aliasLoc = new File(kv[1]);
if (!aliasLoc.exists()) {
throw new IllegalArgumentException(
String aliasName;
}
}
-
resources.unbindFailed=Unbind failed: {0}
resources.invalidAliasPath=The alias path ''{0}'' must start with ''/''
resources.invalidAliasMapping=The alias mapping ''{0}'' is not valid
+resources.invalidAliasNotAllowed=The alias location ''{0}'' is not allowed
resources.invalidAliasNotExist=The alias location ''{0}'' does not exist
resources.invalidAliasFile=The alias location ''{0}'' points to a file that is not a WAR file
standardResources.alreadyStarted=Resources has already been started
<attribute name="aliases" required="false">
<p>This attribute provides a list of external locations from which to
- load resources for this context. These external locations will not be
- emptied if the context is un-deployed. The list of aliases should be of
+ load resources for this context. The list of aliases should be of
the form <code>"/aliasPath1=docBase1,/aliasPath2=docBase2"</code> where
<code>aliasPathN</code> must include a leading '/' and
<code>docBaseN</code> must be an absolute path to either a .war file or
a directory.</p>
+ <p>A resource will be searched for in the first <code>docBaseN</code>
+ for which <code>aliasPathN</code> is a leading path segment of the
+ resource. If there is no such alias, then the resource will be searched
+ in the usual way.</p>
+ <p>Using '/' as an aliasPath is not allowed. Consider using
+ <code>docBase</code> instead.</p>
+ <p>These external locations will not be emptied if the context
+ is un-deployed.</p>
</attribute>
<attribute name="allowLinking" required="false">