aspose file tools*
The moose likes Servlets and the fly likes whats the difference in CGI and servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "whats the difference in CGI and servlets" Watch "whats the difference in CGI and servlets" New topic
Author

whats the difference in CGI and servlets

anurag priya
Ranch Hand

Joined: Dec 19, 2000
Posts: 72
can any one tell me please whats the difference between CGI and servlets
regards anurag.


Anurag priya
SCJP 2(83%); Brain Bench Certified for: Masters level EJB2.0(97%) - Masters level J2EE (83%) - BEA-WebLogic Application Server8.1 (86% )
Hare Rama
Greenhorn

Joined: May 17, 2001
Posts: 9
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

Joined: Dec 19, 2000
Posts: 72
thanx a lot Rama !
reagrds
Anurag.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
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

Joined: Mar 06, 2001
Posts: 13459

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
 
subject: whats the difference in CGI and servlets