You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/02/11 06:55:58 UTC

DO NOT REPLY [Bug 50762] New: Setting a contextPath and docBase makes both available as a context

https://issues.apache.org/bugzilla/show_bug.cgi?id=50762

           Summary: Setting a contextPath and docBase makes both available
                    as a context
           Product: Tomcat 7
           Version: 7.0.8
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: robert.flaherty@oracle.com


1) Under /webapps create a directory /foobar, and add index.html in it.
2) Edit the /conf/server.xml and add <context path="/foo" docBase="foobar" />.
3) Both /foo/index.html and /foobar/index.html are available.

I'm not sure this is spelled out anywhere, but it seems like this shouldn't
expose /foobar/*.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50762] Setting a contextPath and docBase makes both available as a context

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50762

Chuck Caldarale <ch...@unisys.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Chuck Caldarale <ch...@unisys.com> 2011-02-11 01:20:07 EST ---
(In reply to comment #0)
> 1) Under /webapps create a directory /foobar, and add index.html in it.
> 2) Edit the /conf/server.xml and add <context path="/foo" docBase="foobar" />.
> 3) Both /foo/index.html and /foobar/index.html are available.
> 
> I'm not sure this is spelled out anywhere, but it seems like this shouldn't
> expose /foobar/*.

First off, bugzilla is not a support forum.  If you have questions about Tomcat
usage, try the users' mailing list.

Second, your results are exactly as expected.  Note the following from the
Tomcat 7 docs: "It is NOT recommended to place <Context> elements directly in
the server.xml file."  Since you have done so, you have forced double
deployment, once under the directory name of the webapp, once again by the
explicit path setting in your <Context> element.  If you absolutely insist on
placing <Context> elements in server.xml, you should probably disable auto
deployment for the <Host> to avoid the unexpected results.  Better is to never
put <Context> elements in server.xml, and to name the webapp directory
properly.

Look here for more information:

http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50762] Setting a contextPath and docBase makes both available as a context

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50762

--- Comment #1 from Robert Flaherty <ro...@oracle.com> 2011-02-11 01:04:04 EST ---
Also, I tried creating index.jsp instead.  An index_jsp.java gets created under
both:

    /work/Catalina/localhost/foo/org/apache/jsp
    /work/Catalina/localhost/foobar/org/apache/jsp

when I hit both URLs.  If this does get fixed, I'd expect the index_jsp.java to
go to the:

    /work/Catalina/localhost/foobar/org/apache/jsp

directory.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org