hii, i want to display an image in a jsp on a button click.. the image path is stored in the database.. i m retreiving the path through database.. but when i m putting the string in <img/> html tag it is not displaying the image.. it is only displaying images placed in the Web-Content folder of my project..
can the <img/> html tag display any image placed in my system..? please explain
Repeat: you cannot address files directly that are not in a web app. Period.
Using a file path like "C:\whatever" will allow the reference to work on your machine, and your machine only.
Just move the file into a web app. or write a servlet to read the file from disk and serve it indirectly. The latter approach has been discussed hundreds of times in these forums, but should only be used if you absolutely cannot move the files.
Joined: Jun 27, 2009
THANKS a lot for putting me right.. can you send me a link to a similar thread..? i am searching but cant find one.. Thanks..