Display image in JSP

Hi,

I'm having problems allowing users to upload images within my j2ee application and then displaying them again. Does anybody have any tips?

I don't really want to store the image in the db (just the image name), but I can't figure out where to put the image once it has been uploaded so that the JSP page can find it again.

All of my current images are inside my .war file so I can't simply add the uploaded image to these. I'm using JBoss 4.0 if it matters....

Your help is greatly appreciated,

Stu.

[546 byte] By [_DuRdEn_a] at [2007-10-3 4:41:18]
# 1

Hi.

Probably not the best solution, but I've solved this by creating one war file that only holds images. It only has an empty jsp index file.

I use a Unix workstation, so I've creted a symlink, (shortcut) from the folder I uppload images to, to the empty project. Then I can call the images from the jsp, and deploy new versions of my main application without the images....

kristian_groenlia at 2007-7-14 22:45:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thanks for the reply.That's a good idea, I'd never have thought of that! Now the inevitable question.... Do you know if I can do this on Windows?Cheers,Stu.
_DuRdEn_a at 2007-7-14 22:45:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
I have used file system ( on windows out side war)to store images and read them using a servlet and displayed them in JSPgot to this link for the complete code I have used. http://forum.java.sun.com/thread.jspa?threadID=762308&messageID=4350346#4350346
ynroya at 2007-7-14 22:45:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
cheers man, I have it working now!
_DuRdEn_a at 2007-7-14 22:45:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
Can i have the Source code for how to read file from the file system,conevrt to an image and display it on JSPurgent please
Tanujaa at 2007-7-14 22:45:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
no, you can't have it.
jwentinga at 2007-7-14 22:45:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...