O'Reilly logo

Java Servlet Programming by Jason Hunter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

HttpServlet

Synopsis

Class Name: javax.servlet.http.HttpServlet

Superclass: javax.servlet.GenericServlet

Immediate Subclasses: None

Interfaces Implemented: javax.servlet.Servlet, java.io.Serializable

Availability: Servlet API 1.0 and later

Description

HttpServlet is an abstract class that serves as a framework for developing HTTP (World Wide Web) servlets. The public service() method dispatches requests to an HTTP-specific, protected service() method. You may either extend the HTTP-specific service() method (which is then used to handle all types of HTTP requests) or leave the default service method alone and allow it to dispatch requests to particular handler functions for each HTTP submission type: doGet(), doPost(), and so on. Because the default HTTP servlet implementation handles dispatching to these methods, if you override the protected service() method, you must either handle the dispatching manually or not use the handler functions for HTTP request methods.

Class Summary

public abstract class HttpServlet extends javax.servlet.GenericServlet implements javax.servlet.Servlet, java.io.Serializable { // Constructors public HttpServlet(); // Public Instance Methods public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException; // Protected Instance Methods protected void doDelete(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException; // New in 2.0 protected void doGet(HttpServletRequest req, HttpServletResponse ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required