tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffery Cann <>
Subject How to map Absolute URIs to subdirs in Tomcat's 'ROOT' context?
Date Sat, 27 Dec 2003 16:19:23 GMT

I have an application that is currently running within
my $CATALINA_HOME/webapps/mywebapp directory.  I
access it as:


Within this webapp, there is an 'img' subdirectory. 
This contains all of the site images used in JSPs:


Consequently, all of the JSPs use the absolute URI to
reference images, i.e.,

<img src="/mywebapp/img/logo.gif">

Now, I wish run mywebapp in Tomcat's 'ROOT'
application context:  $CATALINA_HOME/webapps/ROOT so
that I can access it as http://localhost:8080/

I changed an example JSP to refer to this absolute

<img src="/img/logo.gif">

[The 'img' subdirectory is now located at
$CATALINA_HOME/ROOT/img after I expanded the

Images referenced using the absolute URI /img/logo.gif
do not load.  Using a web browser, I can navigate to 
http://localhost:8080/img/logo.gif and it will load,
so I don't think there is a permissions problem.

I think when the JSP is compiled by Tomcat, it thinks
that /img is an application context, rather than a
subdirectory of the ROOT application context.

My question:  How can I configure Tomcat to allow my
absolute URI reference to this image subdirectory?  

[NOTE:  For various reasons, like secure (HTTPS)
aliases, we are unable to use relative references to
the 'img' directory.]

Thanks for any suggestions.


Do you Yahoo!?
Free Pop-Up Blocker - Get it now

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message