> From: Christian Schröder [mailto:[EMAIL PROTECTED] 
> Subject: How can I control the path of my web app?
> 
> But now I want my servlets to be accessible at 
> "http://127.0.0.1:8080/foo/bar/MyWebApp/...";.

If you want to use a multi-level URL path to access your webapp, you need to do 
two things:

1) Place your .war file outside of Tomcat's directory structure to avoid having 
it deployed twice.

2) Create a file named foo#bar#MyWebApp.xml in conf/Catalina/[host] that 
contains a <Context> element with a docBase attribute pointing to the absolute 
location of your .war file.  (The value of [host] in the above is usually 
localhost, unless you've fiddled with the <Host> element in the server.xml 
file.)  This will override the META-INF/context.xml file that you may have in 
your webapp.

Also, remove the path attribute from your context.xml; this is not allowed 
unless the <Context> element is within server.xml, which is strongly 
discouraged.  The path is determined by the name of the .war file (or 
directory) if under webapps, or the name of the .xml files under 
conf/Catalina/[host].

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
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: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to