tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
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.
http://tomcat.apache.org/tomcat-5.5-doc/config/resources.html

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

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.

-Tim

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: 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