How to display an image that is stored in a table in Mysql , on a JSP page
pavan manthan
Greenhorn
Joined: Dec 20, 2008
Posts: 6
posted
0
Hi,
As the sub says .. I have been out of luck today trying to display an image that is inserted into a mysql table on a JSP page. The JSp code to do this is given below. the output of this page when i run it : displays the URL of the page i.e
http://localhost:8080/abc/jsp/helloworld.jsp as an image instead of the actual image from the table. Please help me before I get crazy trying to get this thing working :)
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the button on your post.
Well its the only way to store and retrieve the Images from DB. However you are getting the images and storing the files in local directory, so use that relative path and specify the location in your JSP where ever you would like to. Hope that would resolve it. I dont find any convient way apart from this. As I too did the same .