How to Create Servlet
Advertisements
How to Create 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
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 ....... ....... }
Google Advertisment