tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: Problem setting server.xml <host> <context> field.
Date Mon, 08 Jan 2007 20:46:42 GMT
> From: William Holloway [] 
> Subject: Re: Problem setting server.xml <host> <context> field.
> Is the use the name ROOT required for the WAR or is there 
> another way to specify the default context for the Host?

If the webapp is deployed under the <Host>'s appBase directory, then
yes, the name must be ROOT.  If you don't want to use the name of the
installation directory (or .war file) as the app name, put it somewhere
other than under appBase, and create a ROOT.xml file in
conf/Catalina/[host] that contains a <Context> element with a docBase
attribute that specifies the app location.  Somewhere along the line,
the name ROOT must get associated with the app, unless you put the
<Context> element in server.xml, as you discovered.

> I ask because the our development environment uses only the
> localhost Host and being able to copy WARs from the webapps
> dir of dev server to the appBase of the prod environment
> without refactoring would be really nice.

What refactoring?  Ideally, the app should not be cognizant of where
it's deployed or the name it's deployed as.

> I've tried editing the context after exploding the war
> to the empty path attribute but this doesn't work.  Oddly
> enough, this does work if the context info is copied from
> the context.xml file and pasted into server.xml (followed
> by a restart of tomcat).

That's not odd, that's exactly how the doc says it's supposed to work.
Putting <Context> elements in server.xml is strongly discouraged and is
available primarily for compatibility with older levels.

 - Chuck

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message