What Are They?

A Servlet takes its name from the modules of Java code that execute in an application server and provide answers to client requests.  Although Servlet technology is commonly linked with the Hypertext Transfer Protocol (HTTP) they are in fact protocol independent. However, in practice, most are tied to HTTP.

A Servlet is typically used:

A Servlet is written in Java and processes client requests. They are an exact match for the existing Active Web model of receive request, process and generate response.

How do they differ from Common Gateway Interface (CGI)?

In days gone by the traditional mechanism of adding dynamic processing to a web server was with the Common Gateway Interface (CGI). It is a language-independent interface that allows a web server to start an external process which has the request received by the web server presented to it in a standard way through environment variables, its command line and standard input stream. The CGI process then writes its dynamically-generated output to its standard output stream. Each request of the web server requires its own CGI process. CGI processes can typically be written in any language.

Servlet technology has many advantages over this architecture:

Comment on this topic

Topic ID: 150127