ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Servlet and Common Gateway Interface(CGI)
    DevOps/Server 2019. 8. 23. 20:48

    1. Overview

    Servlet technology is used to create a web application which resided at server-side and generate a dynamic web page. Servlet technology is robust and scalable because of java language. Before Servlet, Common Gateway Interface(CGI) scripting language was common as a serverside programming language. However, there were many disadvantages to this technology. 

    2. Description

    2.1 Common Gateway Interface(CGI)

    CGI technology enables the webserver to call an external program and pass HTTP request information to the external program to process the request. For each request, it starts a new process.

    2.1.1 Disadvantages of CGI

    • If the number of clients increases, it takes more time for sending the response
    • For each request, it starts a process, and the webserver is limited to start processes
    • It uses platform-dependent language such as C, C++, and Perl

    2.2 Servlet

    2.2.1 What is a Servlet

    Servlet can be described in many ways, depending on the context

    • Servlet is a technology which is used to create a web application
    • Servlet is an API that provides many interfaces and classes including documentation
    • Servlet is an interface that must be implemented for creating any Servlet
    • Servlet is a class that extends the capabilities of the servers and responds to the incoming requests. It can respond to any requests
    • Servlet is a web component that is deployed on the server to create a dynamic web page

    2.2.2 Advantages of Servlet

    There are many advantages of Servlet over CGI. The web container creates threads for handling the multiple requests to the Servlet. Threads have many benefits over the Processes such as they share a common memory area, lightweight, cost of communication between the threads are low.

    • Better performance: Because it creates a thread for each request, not process
    • Portability: Because it uses Java language
    • Robust: JVM manages servlets, so we don't need to worry about the memory leak, garbage collection, etc.
    • Secure: because it uses Java language

    3. References

    https://www.javatpoint.com/servlet-tutorial

    https://www.baeldung.com/intro-to-servlets

    https://docstore.mik.ua/orelly/xml/jxslt/ch07_04.htm

    'DevOps > Server' 카테고리의 다른 글

    Forward proxy and Reserve proxy  (0) 2019.09.05

    댓글

Designed by Tistory.