Create Servlet
Hello, friends here we will learn about how to create servlet.
- Every servlet class is either directly or indirectly implemented from Servlet interface given by servlet API.
- For programmer convenience, servlet API as provided the same abstract base classes for creating servlet.
- While developing web applications, a programmer can create a servlet class, by using any one of the following three approaches.
- By directly implementing our class from the servlet interface.
Public class myserv implements Servlet
{
}
- By extending our servlet class from a base class called GenericServlet.
Public class myserv extends GenericServlet
{
}
- By extending our servlet class from a base class called HttpServlet.
Public class myserv extends HttpServlet{
}
No comments:
Post a Comment