tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schröder>
Subject How can I control the path of my web app?
Date Mon, 23 Apr 2007 19:07:39 GMT
Hi list!
It seems that I have not yet understood the concept of webapps, 
contexts, servlet mappings etc. I have a long experience with good old 
Apache web server, but I'm quite new to servlet development / deployment 
in general and Tomcat in particular.
My problem is as follows: I have a Tomcat 5.5 server with the 
out-of-the-box configuration. And I have a webapp which is packed in a 
war file, say "MyWebApp.war". This file contains some classes (servlets) 
in the "WEB-INF/classes" directory, a "web.xml" file in "WEB-INF" and a 
"context.xml" in "META-INF". I have write access to the "webapps" 
directory of the server (but only to this directory), so I can place the 
war file there. Tomcat (having "autoDeploy" enabled) then creates a 
directory "MyWebApp" in the "webapps" directory and extracts everything 
from the war file to this directory. After this has been done, I can 
find my servlets at the url ""
Ok, this works fine. But now I want my servlets to be accessible at 
"". How can I achieve this? I 
have tried to create the directory structure in the "webapps" directory 
and put the war file into "webapps/foo/bar", but then Tomcat doesn't 
unpack the war file at all. Simply changing the "path" attribute of the 
"Context" element in my "context.xml" file didn't work, too.
Is this possible at all if I only have access to the "webapps" directory 
(and not, for example, to the manager application)?

Thanks a lot for your help,

My context.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/MyWebApp"/>

My web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="" 

Deriva GmbH                         Tel.: +49 551 489500-42
Financial IT and Consulting         Fax:  +49 551 489500-91
Hans-Böckler-Straße 2        
D-37079 Göttingen

Deriva CA Certificate:

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

View raw message