Detailed description of servlet running process

Source: Internet
Author: User

For example, enter
Http: // ip: Port/web01/Hello


Step 1: the browser establishes a servlet container Based on the IP address and port.
Is also a simple Web Server) connection.


Step 2: the browser packs the request data (according to the HTTP protocol, this packet
Request Packet ).


Step 3: the browser sends the request data packet to the container.


Step 4: After the container receives the request packet, parse the packet and
The parsed data is encapsulated on the request object, and the container
Create a response object.


Step 5: Find the container based on the request resource path ("/web01/Hello ").
Servlet configuration, and then create a servlet object.


Step 6: The container calls the service method of the servlet object. The container will
The created request and response are passed as parameters to the service method.


Step 7: In the service method, you can obtain it through the request object.
Request Parameters and perform corresponding processing. The processing results are placed in the response object.
.


Step 8: The container extracts the processing result from the response object and then packs (
According to the HTTP protocol, this packet is called a response packet ). Then
The response packet is sent to the browser.


Step 9. After the browser receives the response packet, parse the processing result and generate
Corresponding page.

Detailed description of servlet running process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.