JSP Tutorials - Herong's Tutorial Examples - v5.11, by Herong Yang
What Is Servlet
This section describes what is Servlet - A Java based technology that allows you to serve dynamic content with Java Servlet classes through a Web server.
What Is Servlet? Servlet is a Java based technology that allows you to serve dynamic content with Java Servlet classes through a Web server.
Usually, a Servlet enabled Web server will have a Servlet engine (also called Servlet container) working together with the Web server to handle all HTTP requests from Web browsers.
Here is how a typical Servlet container works:
1. A Web browser sends HTTP request to the Web server.
2. The Web server looks at the path name of the request. If it knows how to handle the request, it will send back the HTTP response.
3. If the request refers to a path name managed by the Servlet container, the Web server forwards the request to the Servlet container.
4. The Servlet container looks at the path name of the request and calls the Java Servlet class that is mapped to the path name.
5. The Java Servlet class then executes its programmed logics to generate the HTTP response.
6. The HTTP response will be returned back to the Web browser by the Servlet container.
For more information on Servlet, see the latest release of Servlet specification, https://jcp.org/en/jsr/detail?id=369.
Table of Contents