Explain the purpose of Servlet interface

Explain the purpose of servlet interface.

- The javax.servlet.HttpServlet / javax.servlet.Servlet is the interface that is to be implemented by all the servlets.

- The servlet’s code / actions / implementation is done by implementing this interface.

- The developers need to implement this interface when the application demands , or their application can not / chooses not to inherit from the GenericServlet or HttpServlet.

- For instance the RMI / CORBA that simulates the servlets will need to directly implement this interface.

- The life cycle methods, one init(), one or more service() and one destroy() will be implemented, and invoked by the network service.

- In addition to the life cycle methods, this interface can be used to return information about itself such as version, author, copyright etc.
Explain the underlying method of Servlet interface
The init() method, The service() method, The destroy() method, The getServletConfig(), The getServletInfo() method......
What is GenericServlet class?
This class implements Servlet and ServletConfig interfaces. This class can be extended by a servlet.....
What is HTTPServlet class?
The HTTPServlet class provides an abstract class that is to be sub classed which is suitable for a web site......
Post your comment