GenericServlet (Java(TM) EE 7 Specification APIs) (original) (raw)


public abstract class GenericServlet
extends Object
implements Servlet, ServletConfig, Serializable
Defines a generic, protocol-independent servlet. To write an HTTP servlet for use on the Web, extend HttpServlet instead.
GenericServlet implements the Servlet and ServletConfig interfaces. GenericServlet may be directly extended by a servlet, although it's more common to extend a protocol-specific subclass such as HttpServlet.
GenericServlet makes writing servlets easier. It provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface. GenericServlet also implements the log method, declared in theServletContext interface.
To write a generic servlet, you need only override the abstract service method.
Author:
Various
See Also:
Serialized Form

Copyright © 1996-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.