top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What are the advantages of Servlet over CGI?

+1 vote
What are the advantages of Servlet over CGI?
posted Sep 12, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

CGI means common gateway interface used for server side programming.

Servlet has many advantages over CGI. These are,

1) Each request in servlet is processed by creating separate thread to run service method, i.e.., for each request only service method is executed, not initialized every time.
For each request in CGI the server creates a separate process to execute, which is overhead on server. And process will terminate after processing request. Consumes time and memory.

2)Init, Service, Destroy Life Cycle in Servlet but CGI Passes request to corresponding script.

3)Servlet is powerful as it has implicit support of Java Language itself, but in CGI Should be done explicitly.

4)Servlets are portable among operating systems and among servers, but CGI is not.

5)In Servlet built-in session handling feature but in CGI it should be done explicitely.

answer Sep 12, 2017 by Manikandan J
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.