The clients send requests to the servlets through
HTML forms, and the servlets take on the tasks of the server by responding to these
requests. It is for this reason that servlets are said to ‘extend a server’.
The servlet responds by processing the request, interacting with the database
and generating the results. It then sends the results back to the client who
can view the results generated by the servlet.
Servlets are modules that extend
request/response-oriented servers, such as Java-enabled web servers. They can
be embedded in many different servers. Because of their power and flexibility,
servlets can perform the application processing assigned to the middle tier,
act as a proxy for a client, and even augment the features of the middle tier
by adding support for new protocols or other features.
A middle tier acts as the application server in so-called
three-tier client/server systems, positioning itself between a lightweight
client like a web browser and a data source. For example, a servlet might be
responsible for taking data in an HTML order-entry form and applying the
business logic used to update a company's order database.

A middle tier
serves as a link between clients and back-end services. By using a middle tier
a lot of processing can be off-loaded from both clients (making them lighter
and faster) and servers (allowing them to focus on their mission).
q
A server loads and
initializes the servlet
q The servlet handles zero or more client requests
q The server removes the servlet
