tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Félix Pedrera García <>
Subject Access to static external resources from a webapp in Tomcat 5.5.25.
Date Mon, 26 Nov 2007 15:07:43 GMT

For a webapp deployed on Tomcat 5.5.9 to access static external resources (images, videos,
etc), which we don't want to be deleted when the application is undeployed, we use the following
entry on the context.xml file of the webapp, under the META-INF directory of the web application:

<Context docBase="/path/to/resources" path="/contents">
    <Resources className="org.apache.naming.resources.FileDirContext"/>

Having configured this, we can access the files under /path/to/resources through the URL http://localhost:8080/contents.

This worked perfectly with Tomcat 5.5.9, but when upgrading to Tomcat 5.5.25 the webapp cannot
access the external resources we place outside of the Tomcat webapps directory.

Which is the proper method to access external resources from a webapp has been defined from
version 5.5.10?

This issue has been notified previously to the list, some answers where the following 

"You don't explicitly say where your <Context> element is, but the
implication is that it's inside a file named context.xml in your
webapp's META-INF directory.  If that is the case, both the path and
docBase attributes are ignored.  See:
Look at the descriptions for the two attributes in question.  The
docBase attribute is intended to provide the location of the webapp, not
a link to external resources.

Tomcat versions after 5.5.9 seem to have tightened up enforcement of the
configuration rules."

I understand these attributes are intented to provide a location of the webapp, but in this
case, how do I access to static external resources from a webapp in Tomcat 5.5.25? 

Thanks in advance,

Félix Pedrera.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message