Java Servlets Introduction Tutorial
Java Servlets Introduction Tutorial
Servlets Home
In a Java Web Application to communicate with server we need servlets. Servlet receives user request and send response. In this tutorial, you are going to learn, All about Java Servlets and their types and its lifecycle methods.
Table of Contents
- Introduction to Servlets
- Servlet life cycle
- Servlets Hierarchy
- Servlet Interfaces
- Servlet Classes
- HTTPServlet Package
Introduction to Servlets
Servlets run at server. i.e., they are server side programs which serves to client request. One servlet can serve to multiple requests. When request made to particular servlet It is loaded in memory and initialized and next It will serve the request. If it is no longer required, it is destroyed from memory.
Servlet life cycle
- init
- service
- destroy
All the servlet built-in classes are available in a package called. To create a servlet, you need to import the following package.
javax.servlet Package
TOP Menu
Servlets Hierarchy
The below image depicts the hierarchy of the servlets.
Servlet Interfaces
- Servlet
- ServletConfing
- ServletContext
- ServletRequest
- ServletResponse
Servlet Classes
- GenericServlet
- ServletInputStream
- ServletOutputStream
- ServletException
javax.servlet.http Package
- HttpServletRequest.
- HttpServletResponse.
- HttpSession.
- HttpSessionBindingListener.
- HttpCookie.
- HttpServletEvent.
- HttpServletSessionBindingEvent.
Comments
Post a Comment