what is the advantage of using Servlets over CGI programming?

Answer Posted / mdsha_asiya

The problem with CGI script is that your server must
restart the CGI script every time a new request is
issued.This means every time a client communicates,your
server needs to begin a new proccess .starting and stopping
processes are expensive operions.
The difference between servlet and CGI scritpt is that CGI
script must be restarted every request where as servlets
are pooled and reused over and over again to service many
requests.This means you don't have to restart a process
every time client request comes over the network.

After servlet is loaded,to handle client request it simply
creates a thread and runs service() of servlet.


servlets are more efficient,powerful,portable,inexpensive
and convinent.

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of an http request?

581


What are some advantages of storing session state in cookies?

593


How can we perform any action at the time of deploying the project?

619


What is servlet mapping?

594


Write a program to show the functionality of servlets.

553






How do you invoke a Servlet? What is the difference between doPost method and doGet method?

644


What’s the difference between genericservlet and httpservlet?

526


What do you mean by request dispatcher in servlet? Also explain its methods.

607


What do you mean by cgi in servlet?

627


Describe the phases of servlet lifecycle?

630


What is http servlet?

579


How will two or three servlets interact or communicate with each other?

897


What is getservletcontext?

548


What do you mean by session tracking and also explain its techniques?

496


What is servlet collaboration?

661