1

How can I retrieve and display images from mysql in a JSP page? I want to read database and display all image by id . Result is : [B@4b8c5b6c

I think I need to use servlets How do I write this servlet ?

kbry
  • 421
  • 1
  • 5
  • 4
  • Store image path in database, and set the image path to `src` attribute of `img` tag. – Ali Sepehri.Kh Jan 01 '15 at 18:11
  • @AliSepehri.Kh I tried it but image path for missing records in the database so I keep image type blob in mysql .Now I can't display blob image in my jsp file – kbry Jan 01 '15 at 18:15
  • 1
    There some disadvantages about this: 1.Make your database heavy 2.showing image with this method is difficult 3.Browser itself load images from server but with your method you should send image to client. Don't use this method. – Ali Sepehri.Kh Jan 01 '15 at 18:37

0 Answers0