Table of Content

Servlet – Overview : Java



What are Servlets ?

  1. Servlets used to create web application
  2. Servlets are middle layer of between a request from browser or HTTP client and database application.
  3. Servlets are robust and scalable
  4. Servlets are platform independent
  5. Servlets resides at server side and generates dynamic web page
  6. Servlets are used to collect input through the web forms or to show records from database via web reports.
  7. Servlets performance is significantly better than CGI.
  8. Servlets execute within the address space of a Web server. So it is not not necessary to create a separate process to handle each client request.
  9. Servlets are secure.

Servlets – Diagrammatic Representation

servlet overview

Servlets Execution Steps :

  1. Browser or any HTTP client sent data to the HTTP Server in the form of Web Page.
  2. The request sent by the Browser or client is read by Servlets. Request or data sent includes –
  3. No.Request Sent by Browser includes
    1HTML Form
    2cookies
    3media types
    4compression schemes etc
  4. Servlet then processes the data and generate the results
  5. Servlet then Sends data to the clients (browsers) in verity of formats which includes web page,images, pdf or excel