Step1: Servlet Definition

Servlet definition-

It’s a java program that runs on a server.

Basically, servlet is a server side technology,
-it handles incoming requests from client
-provides response to the server.

High-level diagram that illustrates how a servlet works:

  1. A client, such as a web browser, sends a request to a server.
  2. The server receives the request and forwards it to a servlet.
  3. The servlet processes the request and generates a response.
  4. The servlet sends the response back to the server.
  5. The server sends the response back to the client.

Note- Using Servlets, you can collect input from users through web page forms, present records from a database or another source, and create web pages dynamically.