You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Randall Parker <ra...@nls.net> on 2000/03/06 05:18:41 UTC

Map multiple Context paths to the same docBase?

I'm trying to decide how to organize the URLs for a site. Still using Tomcat v3.0 btw. 

I've tried this in server.xml:

        <Context path="/AdminWorld" docBase="iscribe"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>
        <Context path="/Info" docBase="iscribe"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>

It appears that only the first Context path entry is used. So servlets that are in 
   iscribe/WEB-INF/classes
 can be reached by doing
   http://some-ip-address/AdminWorld/MyServlet

but they can't be reached by doing
   http://some-ip-address/Info/MyServlet

I've tried doing things in web.xml too:
    <servlet-mapping>
        <servlet-name>
            ShowCareerOpptsList
        </servlet-name>
        <url-pattern>
            /info/ShowCareerOpptsList
        </url-pattern>
    </servlet-mapping>

Then this is the path that works.

http://207.105.135.8:8080/AdminWorld/info/ShowCareerOpptsList

I've got two groups of servlets where one group generates the admin forms for entering data in 
some server database and the second group generates the pages that the outside users see 
generated from that database. 

I'd like to have those two groups of servlets in the same context path. But I'd like them 
reachable via different URL paths. Do I need to have that first /something/ be common for 
these two groups of forms if I do it that way?