This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new bb0649554e Fix BZ 66527 - docBase must be absolute here bb0649554e is described below commit bb0649554e816f71eaf29396f2edf65b6ccff5ec Author: Mark Thomas <ma...@apache.org> 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 39142b6b06..debc382397 100644 --- a/java/org/apache/catalina/startup/Tomcat.java +++ b/java/org/apache/catalina/startup/Tomcat.java @@ -240,7 +240,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 */ @@ -712,7 +712,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 */ @@ -745,7 +745,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. @@ -1235,7 +1235,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 e4a51ba2cf..1ba1a3191a 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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org