Advantages of Servlets
- A CGI script spawns a new process every time it is executed,
consuming more processing time and server resources; Servlet does not
- CGI scripts are platform-dependent; Servlet, written in Java, is not
- CGI scripts run in processes that are separate from the server's
process; Servlet does not
- Servlets can write to server log files and can take advantages of
other server capabilities
- Servlets are efficient and scalable because they are handled by
separate threads within the Web server process