tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: How do you do virtual directory / path mapping in a webapp
Date Wed, 10 Jan 2007 18:54:57 GMT
There is no way currently. I have a patch on my local machine which 
allows add this functionality for FileDirContext.

<Context path="/x"
<Resources className="org.apache.naming.resources.FileDirContext"
            aliases="/a1=/mypath/images;/a2=/foopath/images" />

But I haven't had time to see if my patch is secure or compliant if 
someone uses the WebDav servlet.

In the meantime - your best alternative is to use sym links.


Barrie Selack wrote:
> I am converting from Resin and there I can map a directory not inside
> the webapp to one which can be reached via a URL and translated by Resin
> as below:
>   <path-mapping>
>     <url-pattern>/files/*</url-pattern>
>     <real-path>/realdir/files</real-path>
>   </path-mapping>
> I can't seem to find a way in Tomcat to do that. Do I have to write my
> own filter? Any tips or help appreciated.

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

View raw message