Order the Book

coreservlets
Class ImageRetriever

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--coreservlets.ImageRetriever

public class ImageRetriever
extends HttpServlet

A servlet that reads a GIF file off the local system and sends it to the client with the appropriate MIME type. Includes the Content-Length header to support the use of persistent HTTP connections unless explicitly instructed not to through "usePersistence=no". Used by the PersistentConnection servlet.

Do not install this servlet permanently on a public server, as it provides access to image files that are not necessarily in the Web server path.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.

See Also:
Serialized Form

Constructor Summary
ImageRetriever()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
           
 void reportError(HttpServletResponse response, String message)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageRetriever

public ImageRetriever()
Method Detail

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  IOException
Overrides:
doGet in class HttpServlet

reportError

public void reportError(HttpServletResponse response,
                        String message)
                 throws IOException

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive