ervlets process form information in three steps: Retrieve or request the data Store or passing the data Respond to the request What can be done with a servlet can also be done with a CGI (Common Gateway Interface) script, but servlets have a distinct, important advantage--once a servlet is invoked, it is NOT necessary to start a new server process with each request since the servlet stays in memory. CGI scripts, on the other hand, use heavyweight server processes for each request. Low traffic sites may not notice much difference between a script versus a servlet, but a site with heavy traffic loads would have a noticeable performance improvement by using servlets instead of CGI scripts. The Common Gateway Interface (CGI) is a standard for interfacing external applications with information servers, such as HTTP or Web servers. A plain HTML document that the Web daemon retrieves is static, which means it exists in a constant state: a text file that doesn't change. A CGI program, on the other hand, is executed in real-time, so that it can output dynamic information. For example, a Unix database wants to be connected to the World Wide Web, to allow people from all over the world to query it. A CGI program must be created that the Web daemon will execute to transmit information to the database engine, and receive the results back again and display them to the client. This is an example of a gateway, and this is where CGI got its origins. There is no limit as to what you can connect to the Web. The main thing to remember is that whatever the CGI program does, it should not take too long to process. Otherwise, the user will be staring at their browser waiting for something to happen. Since a CGI program is executable, it is basically the equivalent of letting the world run a program on your system, which isn't the safest thing to do. Therefore, there are some security precautions that need to be implemented when it comes to using CGI programs....