This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Display image in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Display image in JSP" Watch "Display image in JSP" New topic

Display image in JSP

chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

How to display image stored in BLOB format .
I want to read it from MySQL and display on JSP page.

Thanks in advance
Ankit Garg

Joined: Aug 03, 2008
Posts: 9291

Well you need to create a servlet which will be mapped to a URL like /serv/image and then in your JSP you have to write something like this

Here I'm taking the image ID to be 3434. The servlet will retrieve the image for that ID and send it as a response. You can search on google for the code for that servlet. this article also shows that type of servlet...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
jQuery in Action, 2nd edition
subject: Display image in JSP
Similar Threads
OutputStream an image within struts2 action class got error - Response already committed
Displaying images on JSP page
thumbnail in jsp
How Display image in a JSP that retrieved from a database?
Displaying an image in jsp