Mark de Lange asks:
> The Servlet that I'm developing generates images on-the-fly. I want to
> include these images into the output HTML code. Is it possible to send the
> image data along with the HTML code?
>
> All examples that I've seen only return an image *or* a HTML page. What I
> need is an HTML page with images.
I'm pretty sure you can only include one or the other in the
response, each element being treated as a separate request. Hm, well,
okay, I take that back, I know HTTP1.1 addresses the overhead of
opening separate request connections for each element, allowing the
browser to request all of the elements in one connection, but I don't
know if there's any way to take advantage of that from a servlet (if
so, it would be the equivalent of generating a jar file on the fly to
answer the request).
> The only working solution that I know of is to save the image to a temporary
> file and include an img tag to that file in the HTML code. But each image
> shall only be displayed once, so it should be a lot cleaner to include the
> image data into the HTML code.
Or you could generate the image and store the binary data in the
session object. This amounts to being the same thing, except it would
avoid writing the temporary image to disk.
Steven J. Owens
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html