Servlets are programs that run on Web server (or Application server, which is usually called servelt container) and act as a middle layer between the web browser and database (or other application).Incoming (request)
Servlet
Outgoing (response)Data from HTML forms, applets and custom HTTP clients
Processes data and if required makes certain database requests etc.
Response in form of HTML pages or explicit documents (Excel,...