> Hello List...
> 
> Using a servlet, I retrieve an image from a database, but I want to send it in
> a formatted html page to the client... any suggestions on how to approach
> this (combining html and streaming images) appreciated.

If you wish to send BOTH html and the image in the same invocation of the servlet, 
then you're mistaken. HTTP/HTML, in general, doesn't work that way. You should make a 
servlet which can retrieve a single picture, something like:

/servlets/showImage?src=my_test_pic.gif

Then make your servlet accept "src" parameter, retrive the image from the database. 
Based on the extension you should set the correct MIME type, in this case "image/gif" 
and send it. You should set Response->contentType to your MIME type and open a servlet 
output stream in the Response and just splash your image into it.

Nix.


Reply via email to