File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

whats the difference in CGI and servlets

 
anurag priya
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one tell me please whats the difference between CGI and servlets
regards anurag.
 
Hare Rama
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
1. CGI is old type of programming which utilizes PERL language whereas servlets uses Java.
2. CGI is laborious because for each client request, new process starts ie compilation & running of the program which delays the process. Whereas servlet will be a precompiled one & gives faster reply.
3. Multithreading option is there with servlet.
Hare Rama
 
anurag priya
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx a lot Rama !
reagrds
Anurag.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me clarify -
"1. CGI is old type of programming which utilizes PERL language whereas servlets uses Java."
Common Gateway Interface - These are the conventions by which a GET or POST parameters can be passed to a program separate from a web server for processing. Although the separate program is frequently PERL, it does not have to be. PhP for example.
"
2. CGI is laborious because for each client request, new process starts ie compilation & running of the program which delays the process. Whereas servlet will be a precompiled one & gives faster reply. "
This is not true in all cases - the Apache server has ModPerl that keeps the Perl engine loaded at all time and can hold compiled programs for re-use.
Bill
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got 2c too
Servlets execute inside a servlet container that (should) determine how the servlet performs and what resources are available to it (ie the container determins how the servlet sees the rest of the world). Via this it can enhance the scalability and performance of the overall app.
Dave.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic