Jean Bresse wrote:

> I was wondering about one thing about web page generation by a servlet.
> Say that you have a web page which contains a picture, or a background
> motif.  Do you need a second servlet to service the picture itself?
>
> There are 2 reasons why I ask this:
>
> 1) With the code I wrote, I'm not able to do it using one servlet only
> 2) I know that the context of the servlet is set to "text / html".  I'm
> only guessing here that the image is of a different context
>
> Your kind and informative feedbacks on this are MOST appreciated...
>
> Thanks,
>
> Jean
>

When you use something like <img src="myimage.gif"> in your generated page,
the image is requested by the brower in a separate HTTP request from the one
that requested this page.  If your image is static, you could just set the URL
of the image to point at a web server to get it, or (if your servlet engine
serves files as well) just let the servlet engine serve it.  On the other
hand, if you need to dynamically create the image (say, you were graphing some
data that was dynamically selected from a database) you might want to have a
servlet create it.  The key is whatever the image URL points at.

Craig

___________________________________________________________________________
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