• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display an image that is stored in a table in Mysql , on a JSP page

 
pavan manthan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :)


Thank You,
Pavan
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Jetendra Ivaturi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic