Creating Servlet


Prev Tutorial Next Tutorial

Creating Servlet

According to servlet API we have three ways to creating a servlet class.

  • By implementing servlet interface
  • By extending GenericServlet class
  • By extending HttpServlet class
Servlet

By implementing servlet interface

Example

public class myServlet implements Servlet
.......
.......
}

By extending GenericServlet class

Example

public class myServlet extends GenericServlet
.......
.......
}

By extending HttpServlet class

Example

public class myServlet extends HttpServlet
.......
.......
}

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements