This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new c66d171343 Fix BZ 66527 - docBase must be absolute here
c66d171343 is described below
commit c66d171343cade7878526a0cf05d87711b534f8a
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Mar 14 18:21:39 2023 +0000
Fix BZ 66527 - docBase must be absolute here
https://bz.apache.org/bugzilla/show_bug.cgi?id=66527
---
java/org/apache/catalina/startup/Tomcat.java | 8 ++++----
webapps/docs/changelog.xml | 5 +++++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/catalina/startup/Tomcat.java
b/java/org/apache/catalina/startup/Tomcat.java
index 35b697f91a..0b60e03362 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -232,7 +232,7 @@ public class Tomcat {
*
* @param contextPath The context mapping to use, "" for root context.
* @param docBase Base directory for the context, for static files.
Must
- * exist, relative to the server home
+ * exist and be an absolute path.
*
* @return the deployed context
*/
@@ -673,7 +673,7 @@ public class Tomcat {
* @param host The host in which the context will be deployed
* @param contextPath The context mapping to use, "" for root context.
* @param docBase Base directory for the context, for static files.
Must
- * exist, relative to the server home
+ * exist and be an absolute path.
*
* @return the deployed context
*/
@@ -724,7 +724,7 @@ public class Tomcat {
* @param host The host in which the context will be deployed
* @param contextPath The context mapping to use, "" for root context.
* @param docBase Base directory for the context, for static files.
Must
- * exist, relative to the server home
+ * exist and be an absolute path.
* @param config Custom context configuration helper. Any
configuration
* will be in addition to equivalent of the default
* web.xml configuration described above.
@@ -1234,7 +1234,7 @@ public class Tomcat {
}
protected URL getWebappConfigFile(String path, String contextName) {
- File docBase = new File(path);
+ File docBase = new File(server.getCatalinaBase(), path);
if (docBase.isDirectory()) {
return getWebappConfigFileFromDirectory(docBase, contextName);
} else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ee686836c4..a1d8e010d8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
<code>authenticationSessionTimeout</code> attribute of the FORM
authenticator. (markt)
</add>
+ <fix>
+ <bug>66527</bug>: Correct the Javadoc for the
+ <code>Tomcat.addWebapp()</code> methods that incorrectly stated that
the
+ <code>docBase</code> parameter could be a relative path. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]