Advantages of servlets over CGI scripts:

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.

3 comments:

  1. Excellent post!!! Your article helped to under the future of java development. Being an open source platform, java is integrated in most of the software development industries to create rich featured applications. Java Training in Chennai

    ReplyDelete
  2. Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post..Interesting post!
    Thanks for writing it.What's wrong with this kind of post exactly? It follows your previous guideline for post length as well as clarity.
    Cloud Computing Training in Chennai

    ReplyDelete