Howdy,
Your JSPs should have the request getContextPath() as part of the image
URL.  Tomcat will not think /img is a webapp, it's smart enough to know
what is and isn't a context path.  And it's too bad you can't have
relative image URLs, as that's really the correct solution.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Jeffery Cann [mailto:[EMAIL PROTECTED]
>Sent: Saturday, December 27, 2003 11:19 AM
>To: [EMAIL PROTECTED]
>Subject: How to map Absolute URIs to subdirs in Tomcat's 'ROOT'
context?
>
>Greetings.
>
>I have an application that is currently running within
>my $CATALINA_HOME/webapps/mywebapp directory.  I
>access it as:
>
>http://localhost:8080/mywebapp/
>
>Within this webapp, there is an 'img' subdirectory.
>This contains all of the site images used in JSPs:
>
>$CATALINA_HOME/webapps/mywebapp/img/
>
>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
>URI:
>
><img src="/img/logo.gif">
>
>[The 'img' subdirectory is now located at
>$CATALINA_HOME/ROOT/img after I expanded the
>mywebapp.war]
>
>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.
>
>Jeff
>
>__________________________________
>Do you Yahoo!?
>Free Pop-Up Blocker - Get it now
>http://companion.yahoo.com/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to