Note: the Servlet technology is not limited to the HTTP protocol.
“Servlet interface” and “GenericSevlet Class” follow the idea that a servlet could be used for any type of service (”not protocol dependent”), such as HTTP, FTP,…etc,… → 2 parameters request and respond are protocol-agnostic.
Are Java classes that dynamically process HTTP requests and construct responses.
a web component that runs on the server side (middle tier) and can act as a controller:
Are Java codes that are used to add dynamic content to Web server.
receive requests, handle and reply back with a response.
There is only a single instance of Servlet created on the Web server.
A Servlet’s initializing code is used only for initializing in the 1st time
To service multiple clients’ requests, the Web server creates multiple threads for the same Servlet instance (Overcome CGI’s consumed more memory)
Gets auto refreshed on receiving a request each time
Servlets are under the control of another Java application called a Servlet Container.
Merits
Enhanced efficiency (initializing only once, auto refresh)
Ease to use (using Java combining HTML)
Powerful (using Java)
Portable
Safe and cheap
Demerits
Low-level HTML documentation (Static well-formed-ness is not maintained)
Unclear-session management
(flow of control within the codes is very unclear)