• 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

java servlets Vs CGI

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to Java and web development. So I am not experience in either Java servlets or CGI.
I would like to know the advantages and disadvantages on using java servlets vs a CGI to do a post for a request and reply from a URL.
With a CGI you do not need a web server running like Websphere. So what are the advantages on using java servlets?
Sandy
 
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi sandy, Marty Hall has a good discussion on this topic.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sandy
basically servlets are the server side components of java and uses the all feature of OOP.And CGI is slower as compare to servlets b/c CGI creates each process for each request even servlet just
create a small fragment of process for each request using the feature of multithreading of java.
Thats the main diff b/w these two.
 
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
"Khurram Shahood(SCJP2)",
Your name does not comly with the JavaRanch naming policy described at http://www.javaranch.com/name.jsp.
The 'SCJP2' part is unnecessary. Please remove it since it would be unfortunate if your account was locked because of this.
You can edit your profile here.
Thanks.
Dave
 
Sandy Schneider
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you need a web server to process a CGI like a servlet?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CGI needs to have some kind of process on the server side. In early days this might be a web server that recognized the CGI url and ran a Perl script. Some ISP allow you to run CGI Perl scripts.
Naturally us Java types run a Java servlet capable web server.
Incidently, servlets and JSP use exactly the same interface as "CGI" so I really don't think there should be a distinction.
Bill
reply
    Bookmark Topic Watch Topic
  • New Topic