1 of 6

Working of Servlet

M.Jeevana sujitha

Assistant Professor

Department of Computer Science and Engineering

SRKR Engineering College, Bhimavaram, A.P. - 534204

Advanced java programming

2 of 6

OBJECTIVES

The Objective of this lecture is

  • To learn about working of servlet.

3 of 6

Working of Servlet

4 of 6

Working of Servlet

  • The client sends a request to the web server. Here the request is Http Request.
  • The web server now takes the help of servlet to develop dynamic web page, because the web server does not have a ability to develop dynamic web page.
  • The web server communicates with servlet with the help of web container or servlet engine.
  • The servlet engine is responsible for invoking methods in servlet.
  • The web container knows which servlet request made by the client with the help of web.xml file.

5 of 6

Working of Servlet

  • The web container takes Http-Request from the web

server and converts this Http-Request into valid

request object and sends to servlet.

  • The web container responds thread for each request. It calls some call back methods like service() and doGet(). The doGet() contains valid business logic.
  • The obtained servlet gathers the relevant information in order to satisfy the clients request

and builds a response object and then sends it to the web container.

  • The web container receives the response object from the servlet and converts this response object to Http-Response and sends it to the web server.
  • Finally the web server sends Http-Response to the client.

6 of 6

THANK YOU