Servlets are platform-independent Java classes which implements the Servlet interface or extends any abstract class which has this Servlet interface implementation defined in javax.servlet package. This has three essential methods for the life cycle of a servlet – init(), service(), and destroy(). They are implemented by every servlet (defined in SDK or self-defined) and are invoked at specific times by the server. Servlets interact with Web clients via a request/response paradigm implemented by the servlet container.
The hierarchy is as follows.
public interface Servlet
public abstract class GenericServlet extends java.lang.Object
implements Servlet, ServletConfig, java.io.Serializable
public abstract class HttpServlet extends GenericServlet
implements java.io.Serializable
No comments:
Post a Comment