Java Servlet Architecture
Overview
In this tutorial, we will learn about Java Servlet Architecture. The Servlet Interface provides five methods, three of which are Lifecycle methods, which are discussed in the Servlet Lifecycle.
Servlet Architecture
The web server receives the client request issued to the servlet, verifies the request, and transfers it to the servlet container.
The servlet container creates a request object, response object, and thread to handle the client request. The request and response objects are stored in the thread object. The container creates a pair of request, response, and thread objects for every client request. For example, if the servlet receives 2 client requests, the container will create 2 pairs of request and response objects and 2 threads. The multiple threads created by the container share the same OS-level process.
The thread will invoke the service() lifecycle method of the servlet by passing the request and the response objects as the parameters. The business logic implemented in the service() method would be executed.
The container will provide the response object from the servlet to the web server.
The web server constructs the response data in the form of a web page and serves the page to the client browser. The container will destory the request, request, and thread.
—
Java Tutorials
Java Tutorial on this website:
https://www.testingdocs.com/java-tutorial/
For more information on Java, visit the official website :