tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Evans <...@webtrak.co.uk>
Subject Changing root webapp
Date Tue, 21 Nov 2000 16:22:39 GMT
In the default tomcat build there is a ROOT webapp which maps to /.  Now I
would like to map the pages and servlets in ROOT to some other path and have a
webapp of my own which handles /.

I tried something like this in server.xml:

        <Context path="/root" 
                 docBase="webapps/ROOT" 
                 debug="0" 
                 reloadable="true" 
                 trusted="true" > 
        </Context>

	<!-- Main applications and servlets -->

        <Context path="" 
                 docBase="webapps/main" 
                 debug="1" 
                 reloadable="true" 
                 trusted="true" > 
        </Context>

In other words, /root will map to the tomcat home page, etc.  It works fine
except of course my main web app is loaded twice: once when server.xml is read
and once at autosetup time.  AutoSetup scans the webapps directory, finds
"main" and because there isn't a /main context, loads the context again.  This
means that my load-on-startup servlets get loaded twice.

Is there a better way of doing this?

Richard

Mime
View raw message