https://bz.apache.org/bugzilla/show_bug.cgi?id=66527

            Bug ID: 66527
           Summary: Embedded Tomcat addWebApp docBase usage is
                    inconsistent with JavaDoc
           Product: Tomcat 10
           Version: 10.1.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: zadel...@gmail.com
  Target Milestone: ------

JavaDoc for Tomcat.addWebApp(String contextPath, String docBase) says docBase
is relative to the server home:

* @param docBase     Base directory for the context, for static files. Must
*                        exist, relative to the server home

However, docBase is eventually passed as the first argument to
getWebappConfigFile(String path, String contextName) where it is evaluated as
if it were an absolute path:

protected URL getWebappConfigFile(String path, String contextName) {
        File docBase = new File(path);
        if (docBase.isDirectory()) {

The docBase.isDirectory() check will fail when docBase is a relative path, and
then we incorrectly end up calling getWebappConfigFileFromWar().

Except for loading the context.xml file, everything else "works" when a
relative path is used, so I assume this is a bug in the implementation and not
the JavaDoc?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to