Shawn Sohl wrote:
>
> How do you embed an image in a servlet and pass it down to the browser.  I
> am reading "Professional Java" and they say you need to use an "Encoder"
> object that isnt available in 1.2.  Is there an "Encoder" object available
> in 1.3? and if so how do I use it?

You don't embed an image in a servlet. You can do two things.

- Put an img tag into the html that is sent to the client. The client
requests the image from the web server using HTTP.
- Put an href into the html that makes a servlet request. The href
includes the image url or filename so that the servlet knows where to
find the image. The servlet reads the bytes from the url or file, and
streams the bytes back to the client using an output stream obtained
from the response object.

___________________________________________________________________________
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