head	1.5;
access;
symbols;
locks
	nobody:1.5; strict;
comment	@# @;


1.5
date	99.07.21.23.50.52;	author nobody;	state Exp;
branches;
next	1.4;

1.4
date	99.07.07.22.44.14;	author nobody;	state Exp;
branches;
next	1.3;

1.3
date	99.07.07.22.43.58;	author nobody;	state Exp;
branches;
next	1.2;

1.2
date	99.06.24.23.40.39;	author nobody;	state Exp;
branches;
next	1.1;

1.1
date	99.06.24.23.40.23;	author nobody;	state Exp;
branches;
next	;


desc
@null
@


1.5
log
@null
@
text
@IDependOn-Set: 1
IDependOn-Set: 119
IDependOn-Set: 2
IDependOn-Set: 232
IDependOn-Set: 241
IDependOn-Set: 257
LastModifiedSecs: 931387454
Parent: 119
SequenceNumber: 2
Title: Displaying images with servlets...
Part: 0
Author-Set: jon@@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 931387454
Type: monospaced
Lines: 52
----------
From: "Craig R. McClanahan" <cmcclanahan@@mytownnet.com>
To: Java Apache Users <java-apache-users@@list.working-dogs.com>
Subject: Re: displaying images within servlets
Date: Wed, Jul 7, 1999, 3:07 PM


--

Allan Stuart Meidlein wrote:

> --
>
> Hello All,
>
> I have searched through the FAQ-o-Matic and have only found one entry
> related to images and servlets.  What I need to do is display some
> simple images within the servlet along with text; I understand that the
> HTML content type must be set to 'text/gif" or whatever format, but I'm
> confused at how I can have text and images on the same page when my
> content type is already set at "text/html."
>
> Thanks in advance.
>
> Allan
>

First, the content type for a GIF image is "image/gif", not "text/gif".

You are correct that you can not mix text and image output in the same
page.  What you need to do is include a normal image link, like this:

    <img src="xxxxx">

in the text output of your servlet (just as if you were authoring a
stand-alone HTML page).

Now, what is "xxxxx"?  Well, if the images you are talking about are
available at a particular URL on your web server, just use that URL and
the browser will download it in the usual way.

It is also possible to have a servlet dynamically create an image, by
using a URL that points back at your servlet.  An example is where you
might be constructing a graph image on the fly, using some graphics
library.  You will need to do something in the URL to tell your servlet to
return the image instead of a text page.

The browser will request this URL on a separate request from the one that
is causing your page to be created, so you never have to mix text and
binary data on the same request.

Craig McClanahan
EndPart: 0
@


1.4
log
@null
@
text
@d6 1
@


1.3
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 931387438
d8 1
a8 1
SequenceNumber: 1
d10 59
@


1.2
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 930267623
d8 2
a9 2
SequenceNumber: 0
Title: New Item
@


1.1
log
@null
@
text
@d4 1
@
