I'm trying to figure out why I get repeated directory names when calling "application.getRealPath(request.getRequestURI())" from an index.jsp file. Clearly there's something about virtual hosts and contexts that I'm missing.
Using Tomcat 5.5 & 6.0 in standalone mode under Windows XP, I see the following behavior: A request for the url: http://www.nomad.org/gallery/ yields a real path of: C:\Documents and Settings\Peter\My Documents\dev\webapps\www.nomad.org\gallery\gallery (note the duplication of the gallery directory) Why? In my server.xml file I defined this virtual host: <Host name="www.nomad.org" appBase="C:\Documents and Settings\Peter\My Documents\dev\webapps\www.nomad.org" unpackWARs="true" autoDeploy="true" xmlValidationfiltered="false" xmlNamespaceAware="false"> </Host> If I don't define any contexts, the problem occurs. The problem also occurs if I have either of the following contexts defined for this host: <Context path="/gallery" docBase="gallery" /> or <Context path="/gallery" docBase="/gallery" /> If I set the gallery context to: <Context path="/gallery" docBase="" /> the duplicate folder name goes away, but my gallery web.xml does not get read. Thanks for any help, Peter --------------------------------- Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.