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...