>>I have a image in Oracle Blob field and i want to renderize it my jsp.
>Do I need to use <hmtl:image> or <html:img> or this is not the way? My
>form property is a Blob, but i guess that this tags dont support this

Hi,

First remember how images work in HTML. the <img src=...> attribute is
treated as an href, so there are actually two separate HTTP requests:
one to render the JSP and one to fetch and display the image.

The only thing that changes if your image is stored in an Oracle BLOB
is, instead of <html:image> pointing to a file resource, it has to point
to a servlet that you write yourself.   The servlet fetches  the BLOB
from your table, sets the Content-Type properly (image/gif, image/jpeg)
and writes the bytes to response.getOutputStream.

One thing to remember is, you _can't_ retrieve images from within an
Action because you are only allowed to call response.getOutputStream
once during the request and Struts' ActionServlet already appears to do
that.  So you have to write an actual servlet.

Hope this helps,
Bill
--
Bill Schneider
Chief Architect

Vecna Technologies
5004 Lehigh Rd., Suite B
College Park, MD 20740
[EMAIL PROTECTED]
t: 301-864-7594
f: 301-699-3180


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to