You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt Galvin <ma...@gmail.com> on 2005/05/03 21:29:11 UTC

Help - Alias or Symlink to external(to the context) images directory?

Hi All,

Does anyone know of a way to set an alias to an external directory
that contains images to be displayed on a web page?

Maybe explaining what I need to do would help:

I have a directory, for example: /tmp/images
I have a webapp in: /opt/tomcat/webapps/myapp

I need to be able to store uploaded images in /tmp/images (which I
have working fine) and I need to be able to display those images via
the jsp's in myapp. Is it possible to have an alias called
myapp/images that points to /tmp/images or can I maybe use a
symlink(can tomcat follow the symlink?) or is there some other way I
can do this, other than using a servlet to retrieve/return the images?

I need to be able to do this so that when the webapp is
updated/redeployed, the images will not get deleted.

I am running tomcat 5.0.28 on SUN's Java 1.4.2_08 on a variety or
Linux/UNIX systems.

Thanks in advance,

Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Help - Alias or Symlink to external(to the context) images directory?

Posted by Matt Galvin <ma...@gmail.com>.
On 5/3/05, Mott Leroy <mo...@acadaca.com> wrote:
> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html -
> 
> see the "allowLinking" property.

This did the trick :) Thanks Mott!!!

> As far as how to create the symlink when the app is deployed, not sure
> beyond running some sort of script when the application loads (using a
> context listener perhaps).

I actually have a script that deploys the app for me, so in that
script I create the symlink after deploying.

Thanks again,

Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Help - Alias or Symlink to external(to the context) images directory?

Posted by Mott Leroy <mo...@acadaca.com>.
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html -

see the "allowLinking" property.

As far as how to create the symlink when the app is deployed, not sure 
beyond running some sort of script when the application loads (using a 
context listener perhaps).

Matt Galvin wrote:

>Hi All,
>
>Does anyone know of a way to set an alias to an external directory
>that contains images to be displayed on a web page?
>
>Maybe explaining what I need to do would help:
>
>I have a directory, for example: /tmp/images
>I have a webapp in: /opt/tomcat/webapps/myapp
>
>I need to be able to store uploaded images in /tmp/images (which I
>have working fine) and I need to be able to display those images via
>the jsp's in myapp. Is it possible to have an alias called
>myapp/images that points to /tmp/images or can I maybe use a
>symlink(can tomcat follow the symlink?) or is there some other way I
>can do this, other than using a servlet to retrieve/return the images?
>
>I need to be able to do this so that when the webapp is
>updated/redeployed, the images will not get deleted.
>
>I am running tomcat 5.0.28 on SUN's Java 1.4.2_08 on a variety or
>Linux/UNIX systems.
>
>Thanks in advance,
>
>Matt
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org