You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2007/09/05 16:36:10 UTC

mapping directory in Tomcat?

Hi,

My server runs only tomcat 5.5, and my app needs to copy some jpeg files to
a temporary directory so that  the generated page can refer to them like:
<img src = "http://mydomain.com/temp/J12345.jpg", now how to map a directory
in the file system to http:/mydomain.com/temp? Thanks.

A.C.
-- 
View this message in context: http://www.nabble.com/mapping-directory-in-Tomcat--tf4384478.html#a12499364
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mapping directory in Tomcat?

Posted by Lionel Crine <lc...@linagora.com>.
To complete the answer, you can use JNDI variables.

Hassan Schroeder wrote:
> On 9/5/07, Angelo Chen <an...@yahoo.com.hk> wrote:
> 
>> The servlet mapped directory sounds interesting, can you give me some more
>> info about that?
> 
> Not much to say; your servlet would take the pathInfo part of the
> URL and read that image out of the filesystem.
> 
> The path to your external temp directory could be hardcoded in the
> servlet, set in web.xml, or read from a properties file (my pref).
> 
> Pretty straightforward...
> 
> HTH!

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


Re: mapping directory in Tomcat?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 9/5/07, Angelo Chen <an...@yahoo.com.hk> wrote:

> The servlet mapped directory sounds interesting, can you give me some more
> info about that?

Not much to say; your servlet would take the pathInfo part of the
URL and read that image out of the filesystem.

The path to your external temp directory could be hardcoded in the
servlet, set in web.xml, or read from a properties file (my pref).

Pretty straightforward...

HTH!
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

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


Re: mapping directory in Tomcat?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Hassan,

The servlet mapped directory sounds interesting, can you give me some more
info about that? 
Thanks,
A.C.


Hassan Schroeder-2 wrote:
> 
> On 9/5/07, Angelo Chen <an...@yahoo.com.hk> wrote:
> 
> You could use a symlink, or you could use a servlet mapped to /temp/*
> 
> HTH,
> -- 
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> 

-- 
View this message in context: http://www.nabble.com/mapping-directory-in-Tomcat--tf4384478.html#a12505493
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mapping directory in Tomcat?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 9/5/07, Angelo Chen <an...@yahoo.com.hk> wrote:

> My server runs only tomcat 5.5, and my app needs to copy some jpeg files to
> a temporary directory so that  the generated page can refer to them like:
> <img src = "http://mydomain.com/temp/J12345.jpg", now how to map a directory
> in the file system to http:/mydomain.com/temp? Thanks.

You could use a symlink, or you could use a servlet mapped to /temp/*

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

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