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

Explain the war file?

835


What is the difference between the http servlet and generic servlet?

885


What is a web container and what is its responsibility?

740


What are the advantages of servlets over traditional cgi?

826


What are all the advantages of servlet over cgi?

815


What are different Authentication options available in Servlets.

799


What is cookies in servlet with example?

731


What is the element?

794


When servlet is loaded?

807


What is servlet and its types?

788


Elucidate servlet attributes and its scope?

766


Why do we need a constructor in a servlet if we use the init method?

744


Which HTTP method is non-idempotent?

821


What are the two important api's in for servlets?

811


Explain the role of dispatcherservlet and contextloaderlistener.

897