The most important difference between CGI and Servlet

xiaoxiao2021-03-06  24

In summary, the servlet can complete the same functionality as CGI.

CGI applications are difficult because it requires programmers to have knowledge that handles parameters, which is not a common skill. CGI cannot be portable, CGI applications written for a particular platform can only be run in this environment. Each CGI application exists in a process that is activated by the client, and is uninstalled after the request is served. This mode will cause a high memory, CPU overhead, and do not serve multiple customers in the same process.

Servlet provides all the advantages of Java applications - portable, robust, easy development. With Servlet TAG technology, servlet can generate dynamic content embedded in a static HTML page.

The main advantage of servlet on CGI is that a servlet is activated by the first request sent by the client, and then it will continue to run in the background, waiting for future request. Each request will generate a new thread instead of a complete process. Multiple customers can get services at the same time. In general, the servlet process is only uninstalled when the Web Server is uninstalled. (see picture 1)

转载请注明原文地址:https://www.9cbs.com/read-61104.html

New Post(0)