Servlet call process, servlet call

Source: Internet
Author: User

Servlet call process, servlet call

(1) enter the address in the browser. The browser first searches for the hosts file and translates the host name into an IP address. If the host name cannot be found, the browser then queries the dns server and translates the host name into an IP address.

(2) the browser accesses the server based on the IP address and port number, and organizes http request information to be sent to the server.

(3) After receiving the request, the server first checks the virtual Host currently accessed Based on the Host request header.

(4) The server determines which web application is currently accessed based on the request URI in the http request header.

(5) The server determines which web application is currently accessed based on the request URI in the http request header.

(6) Check the web. xml file of the web application. If you find all the paths of the specific servlet processing Class Based on the path, submit the paths to the servlet for processing. If not, submit them to the default servlet for processing.

(7) In this process, the browser only knows that it has sent an http request and soon received an http response. The browser does not know or care about how the server processes the request. The relationship between the browser and the server is very simple, only HTTP protocol.

(8) parsing requests, encapsulating RequestResponse objects, creating Servlets, and calling Servlet methods are all automatically performed by the server. Developers only need to write the Servlet and call the Service method automatically by the server, we only need to write the Servlet configuration into the container.

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.