• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet Vs CGI

 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is any way CGI is better than Servlet.if so how??
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Third question here:
http://faq.javaranch.com/view?JavaRanchFaq
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic