What are advantages of servlets over CGI?
Servlets are easier to write.
Servlets are faster to run.
Servlets are platform independent. CGI has the disadvantage of doing server-side programming with platform-specific APIs.
Servlet can handle multiple request concurrently, and synchronize requests.
The servlets can be used to balance load among several servers that mirror the same content and to partition a single logical service over several servers, according to task type or organizational boundaries as servlets can forward requests to other servers and servlets.
A Servlet does not run in a separate process. This removes the overhead of creating a new process for each request.CGi create separate process for each request.Which may be cause memory issue.