CCL Home Page
Up Directory CCL t013.html
slide

Jan K. Labanowski: "Tomcat, servlets, JSPs and other friends"

Common Gateway Interface

Most popular approach:

  • server receives request to execute a file (e.g., C program or perl script). Server knows that the file should be executed rather than returned, since it is in a special directory or has a special extension.
     
  • server starts a new process (forks a new shell, and runs the file) with parameters given on the command line (the GET method), or sent to the program as STDIN (POST method).
     
  • The program sends output to STDOUT, and this output is sent back to the browser (with the addition of the few response header lines, e.g., Content-Length).
     
  • External program dies/exits, and if it is needed again for the next request, the whole process has to start all over.
     
Very taxing on computer... Each request is like starting a new program.

Modified: Wed Feb 13 20:23:37 2002 GMT
Page accessed 2796 times since Mon Feb 3 15:33:32 2003 GMT