• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I show Images coming from DataBase  RSS feed

 
Parshuram Walunjkar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,
I am trying to show image in jsp which is coming from DataBase(BLOB) in FileOutPutStream .It comes dynamically .
Can any one help me to show that image in jsp but i don't want that image to be store on disk.Because there are so many images which i want to show as per user login.
Plaese help me.
Regards and Thanks
From Parshuram Walunjkar
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most important things to remember are:
1. Each image displayed by a browser comes from a separate request.
2. You have to use your JSP to build a page in which the <IMG tag has a SRC url that points to something which can serve that image data as binary data.
3. JSP is designed to serve character data, not binary data.
4. When serving image data you must set the content type correctly - and it is a good idea to set the content length correctly too.
5. Therefore your image data should come from a servlet. Don't panic, it isn't that hard.
Bill
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the advantage to having the images stored as a BLOB? I have always assigned images to a user by storing the path instead.
Just curious as to what the benefit is...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!