tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Hut" <ch...@onetruemedia.com>
Subject Resources / docBase question
Date Sat, 02 Feb 2008 10:42:34 GMT

Hi all,

I'm wondering how to point Tomcat to an expanded webapp location whose
resources are served from a different location.

It's easy to point Tomcat to external resources by providing a
deployment descriptor; for example, if I have the following in
${CATALINA_BASE}/conf/Catalina/localhost/imageApp.xml:

<Context docBase="c:/images" />

Then requests for: localhost:8080/imageApp/foo.jpg will serve the file
from c:/images/foo.jpg

But, I want to add servlet filtering to the webapp with the class files
in my expanded application hierarchy (containing a WEB-INF/classes and
web.xml file):

<Context docBase="c:/source/imageApp" />

Now localhost:8080/images/foo.jpg will 404 (requested resource not
available) because the file isn't in the source/imageApp hierarchy -
makes sense so far.

I thought that configuring a <Resources> element for the <Context>,
redefining the docBase to my external directory, might do the trick:

<Context docBase="c:/source/imageApp">
	<Resources
className="org.apache.naming.resources.FileDirContext"
docBase="c:/images" />
</Context>

But image requests are still resulting in a 404 not found.

Is there a way (other than using symlinks) to run code from an expanded
webapp hierarchy docBase but serve static content from an external
location?

Thanks much!
Chris

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message