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 do you mean by deployment descriptor?

559


What is cgi?

607


how many jsp scripting elements are there and what are those?

548


What is a web application and what is it’s directory structure?

592


What is the use of httpservletrequestwrapper and httpservletresponsewrapper?

549






What are the steps that are involved in using the httpservlet class?

583


How can we refresh automatically when new data has entered the database?

626


Whether we can get deadlock situation in servlets?

580


What is context in servlet?

549


How the servlet is loaded?

606


Why session tracking is needed?

592


What is servlet instance?

546


What is a servlet context object?

630


Can we override servlet service method?

591


What is the difference between portlet and servlet?

521