GenericServlet is a pre-defined abstract class provided by the Java Servlet API. GenericServlet defines protocol independent servlet. The class is defined in the javax.servlet package.
GenericServlet class is an abstract class and the container does not create any object for this class. The class implements the following interfaces:
The Servlet interface defines methods that all servlets must implement. ServletConfig defines a servlet configuration object used by a servlet container to pass the information to the servlet during the initialization phase.
GenericServlet provides simple implementations for most of the methods in the Servlet and the ServletConfig interface. It contains the following abstract method:
This method is not implemented. We can extend GenericServlet class to create a servlet.
The subclass should override and provide an implementation for the service() method.
Java Tutorial on this website:
For more information on Java, visit the official website :