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

Is it good idea to create servlet constructor?

745


How servlet is created?

548


How many servlet objects are created?

567


Difference between httpservlet and generic servlets?

608


Which are the different ways you can communicate between servlets?

530






What is the advantage of Servlets when compared with other server side technologies?

1861


What do you mean by url pattern in servlet?

631


Explain session tracking and its importance?

548


Is servlet a server side scripting language?

555


When to use doget() and when dopost()?

629


How do you create a cookie using servlet?

581


Explain the working of service() method of a servlet.

508


Explain the difference between servletconfig and servletcontext in servlet?

577


How the JSP file will be executed on the Server side?

646


What are the disadvantages of storing session state in cookies?

631