• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Vs CGI

 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is any way CGI is better than Servlet.if so how??
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is a single technology while the common gateway interface can be set up to work with several technilogies such as perl and C. If Java can do everything then this isn't a problem, but if you like to do the right job with the right tool then it is worth considering other options.

Also, while servlets are good at running multiple applications, it doesn't support the same configuration as CGI in some servers, which is why ISPs typically offer CGI access but not Java.

Dave.
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David

Thanks for ur reply

while servlets are good at running multiple applications, it doesn't support the same configuration as CGI in some servers


can you explain little bit on this line.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, I knew that wasn't phased correctly after I re-read it

Servlet containers are designed to run enterprise applications, and their configuartion options reflects this. While it is not impossible, it is not always easy to set up user-spaces on the internet to cleanly share a servlet container. For example the way internet service sproviders can allow users to have their own myISP.com/myname/ webspace and run CGI scripts from it.
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi david

ya little bit sticking to the mind

Is there any special reason that javaranch still using cgi rather then going for java.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Third question here:
http://faq.javaranch.com/view?JavaRanchFaq
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When ever there is a request for CGI script container creates a seperate process for it. Containers have a limitation on the number of process that it can create.

In servlets every incoming request is handled by a seperate thread.

The most popular platform for writing CGI script is Perl. The server needs to load the CGI script and Perl interpreter for every incoming request that it receives. This brings down the efficiency of the server.

Unlike CGI script the servlet initialization code is executed only once.
 
rajsunder reddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishnu Prakash:
When ever there is a request for CGI script container creates a seperate process for it. Containers have a limitation on the number of process that it can create.

In servlets every incoming request is handled by a seperate thread.

The most popular platform for writing CGI script is Perl. The server needs to load the CGI script and Perl interpreter for every incoming request that it receives. This brings down the efficiency of the server.

Unlike CGI script the servlet initialization code is executed only once.



you are mistaken buddy, now we have servers that only need to load the perl interpreter only once and when request comes up it only opens up a new data area for each incomming request and processess the incomming request
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!