Mark de Lange wrote:
>
> Hi,
>
> 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.
>
> 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.

The browser can only handle one type of content at the time so you need
to separate the output into two separate requests. For instance, let one
servlet generate HTML with something like this:

  <IMG SRC=/servlet/imageGenerator?foo=bar>

and then let your imageGenerator servlet use the parameter value (foo=bar here)
to generate the image dynamically.


--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

___________________________________________________________________________
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

Reply via email to