You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by mshowers <mr...@hotmail.com> on 2009/11/10 15:14:36 UTC

Uploading Images - Refresh Directory

Looking for some help - I am using DWR (ajax) to upload image files to my web
app. 

The app is running on Tomcat v6.0.

I'm putting the files into a directory in WebContent\images or
WebContent\images\<sub directories>

When I upload the images, I then want to display them on my page. heres the
problem.

Even if I reload the page, the images will not appear on the page untill I
go into the eclipse IDE and "REFRESH" the WebContent or Images directory.

Any suggestions as to how I can get around this?

Thanks!
-- 
View this message in context: http://old.nabble.com/Uploading-Images---Refresh-Directory-tp26284142p26284142.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Uploading Images - Refresh Directory

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

mshowers,

On 11/10/2009 9:14 AM, mshowers wrote:
> Looking for some help - I am using DWR (ajax) to upload image files to my web
> app. 
> 
> The app is running on Tomcat v6.0.
> 
> I'm putting the files into a directory in WebContent\images or
> WebContent\images\<sub directories>

Is that directory inside the deployment directory of your webapp? Don't
do that!

> When I upload the images, I then want to display them on my page. heres the
> problem[:]
> 
> Even if I reload the page, the images will not appear on the page untill I
> go into the eclipse IDE and "REFRESH" the WebContent or Images directory.

What does REFRESH do in Eclipse? Does it re-deploy/reload the webapp? If
so, then you're hitting Tomcat's directory-caching behavior which makes
it difficult to put new files into the deployment directory while Tomcat
is running. Again, don't do that!

> Any suggestions as to how I can get around this?

Put your files somewhere else, and map a URI in your web application to
a servlet that can fetch the files (and/or directory listings) from that
other directory.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr50IoACgkQ9CaO5/Lv0PCPdQCcCRMlLLeREidPj+GY+1AW0Deb
GJkAn2l75eKsvM2lCRENCfJhO+3Od/mL
=VDng
-----END PGP SIGNATURE-----

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