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

How to upload a file to the server using servlet?

770


Which event is fired at the time of setting, getting or removing attribute from application scope?

904


Why do we have servlet filters?

805


Can filter be used as request or response?

756


Is servlet thread safe?

773


Explain load on start-up and its importance?

869


What is servlet invoker?

804


What are the types of servlets? Explain

957


Explain Action Servlet?

846


What are the differences between servlet context vs servlet config?

843


What do you mean by cgi and what are its drawbacks?

755


What are the phases of a servlet life cycle?

869


What are the types of Session Tracking ?

880


How do we translate jsp?

793


What are the advantages of cookies?

847