Yes, make the image element's src attribute a call to a servlet that 
just streams out the image.  So for example, in your HTML page you have:

<img src="http://mydomain.com/mywebapp/imagestreamservlet?imageID=xxx";>

Then the 'imagestreamservlet' does the image lookup and streams it out 
to the response writer (i.e. response.setContentType("image/gif") or 
image/jpeg, or whatever, then grab response.getWriter() and start 
writing bytes from a reader on the image file to it).

The only sticking point is that you do not know the image dimensions 
before grabbing the image (duh!), so if you need width/height info for 
the image in the page, it may be worthwhile having the HTML page also 
produced by a servlet that also looks up the image, but only retrieves 
metadata about it and sticks it in the appropriate places.

jeff

john-paul delaney wrote:

> 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.
> 
> thanks
> /j-p.
> 
> 
> -----------------------
>  JUSTATEST Art Online
>   www.justatest.com
> 
> 
> 
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
> 
> 
> 


-- 
Jeffrey Bonevich
Ann Arbor, Michigan
[EMAIL PROTECTED]
http://www.bonevich.com

Hw�t! W� G�r-Dena   in ge�r-dagum,
peod-cyninga,       prym gefr�non,
h� �a aepelingas   ellen fremedon!


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to