what is the advantage of using Servlets over CGI programming?
Answer Posted / sandeep m
CGI programs need separate process to process a request.
For which CGI object has to be created and destroyed for
each request or else pool of processes can be maintained by
server and for each request a process is assigned by server
which will be returned back to server after request
processing.
Servlets use Threads. Due to which single Servlet object is
created. Whenever a request is received by server a new
thread is created and the thread uses the existing Servlet
instance.
Advantage is process creation is heavy weight. Threads are
light weight. Burden of creating and destroying processes
is reduced or else maintaining process objects in pool is
reduced. Any number of requests can be served with not much
burden on server
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What exactly is a servlet?
What’s the difference between sendredirect and forward methods
How do you configure a centralized error handler in servlets?
What is preinitialization of a servlet?
Write a program to show the functionality of servlets.
What are the exceptions thrown by servlets? Why?
Explain the working of service() method of a servlet.
What is the use of httpservletresponsewrapper?
When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?
When jsessionid is created?
What is called a session?
Explain the difference between servletconfig and servletcontext in servlet?
How can you push data from an Applet to a Servlet?
What do you mean by deployment descriptor?
Which method of the httpservletrequest object is used?