28

What is exactly meant by CGI programming . If I am writing a cgi program in 'C' ,

in that context , what does the 'cgi' mean ?

Is the servelt environment is an abstraction of classical cgi programming ?

Mariselvam
  • 1,093
  • 2
  • 15
  • 28

5 Answers5

9

CGI means common gateway interface...It is a web server that receives user request and process that and sends the response back to the user..In CGI for each new user request the new process has been created and process the user request and forward the response back to the user

Revathi Bala
  • 159
  • 2
  • 2
7

See The Common Gateway Interface (CGI) is a standard protocol that defines how webserver software can delegate the generation of webpages to a console application. Such applications are known as CGI scripts; they can be written in any programming language, although scripting languages are often used.

http://en.wikipedia.org/wiki/Common_Gateway_Interface

Vivek Goel
  • 22,942
  • 29
  • 114
  • 186
3

No, the servlet environment is not an abstraction from it. Servlets are loaded into the JVM when they are first requested and are instantiated/executed/deallocated like any other Java object. The CGI process has the web server invoke an external program (Perl/Ruby/Python interpreter or a C-based CGI app), it runs and then exits completely.

Mike Thomsen
  • 36,828
  • 10
  • 60
  • 83
  • thanks mike , I just want to make sure that I have understood the concept , do u mean that, the server and the program(servlet ) which generates dynamic page both are in the same runtime enviroment ( JVM ) ? So that servlet environment is not an abstraction of cgi spec ? – Mariselvam Feb 20 '11 at 18:24
1

The oldest and still very common way to add interactivity to a web page is through a CGI program. Common Gateway Interface(CGI) is a protocol standard that specifies how information can be passed from a Web page through a Web server, to a program, and back from the program to a browser in the proper format. Unfortunately many people confuse the actual program that does a particular task with CGI protocol. In reality, it happens to be a CGI program as it was written to pass information back and forth using CGI specification.

AnoNymOus
  • 11
  • 2
1

Common Gateway Interface - It is explained here: http://www.openroad.org/cgihelp/cgi.html

Phil C
  • 3,687
  • 4
  • 29
  • 51