Class ColorServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class ColorServlet
    extends GenericServlet
    Creates a minimal 1 x 1 pixel PNG image, in a color specified by the "color" parameter. The color is HTML-style #RRGGBB, with two digits hex number for red, green and blue (the hash, '#', is optional).

    The class does only byte manipulation, there is no server-side image processing involving AWT (Toolkit class) of any kind.

    Version:
    $Id: ColorServlet.java#2 $
    Author:
    Harald Kuhr, last modified by $Author: haku $
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorServlet()
      Creates a ColorDroplet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void service​(javax.servlet.ServletRequest pRequest, javax.servlet.ServletResponse pResponse)
      Renders the 1 x 1 single color PNG to the response.
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ColorServlet

        public ColorServlet()
        Creates a ColorDroplet.
    • Method Detail

      • service

        public void service​(javax.servlet.ServletRequest pRequest,
                            javax.servlet.ServletResponse pResponse)
                     throws java.io.IOException,
                            javax.servlet.ServletException
        Renders the 1 x 1 single color PNG to the response.
        Specified by:
        service in interface javax.servlet.Servlet
        Specified by:
        service in class javax.servlet.GenericServlet
        Parameters:
        pRequest - the request
        pResponse - the response
        Throws:
        java.io.IOException
        javax.servlet.ServletException
        See Also:
        class description