Tomcat related skills

xiaoxiao2021-03-06  39

Tomcat Server.xml

A context corresponds to a web application, a web application consists of one or more servlets. Context will load servlet based on the configuration file $ CATALINA_HOME / CONF / Web.xml and $ WebApp_home / Web-INF / Web.xml when Crestness is created Class When Context gets a request, you will find a matching servlet class in your own mapping table (Mapping Table).

Conf / web.xml is a global deployment file for all applications, which deploys the basic servlet image, including Default, JSP, Invoke, CGI, also describes the MIME and the default home file .tomcat-Server diagram is as follows:

2.

Tomcat Server processes an HTTP request

Suppose requests from customers are: http: // localhost: 8080 / wsota / wsota_index.jsp

1) Requests to be sent to the local port 8080, which is listened to the COYOTE HTTP / 1.1 Connector to get 2) Connector handles the request to the service of the service to process, and wait for response from Engine 3) Engine Request localhost / wsota / wsota_index.jsp, matches all of its virtual host host4) Engine matches Host-called LocalHost (even if it does not assign the request to the HOST process, because the Host is defined as the engine Default Host) 5) LocalHost Host Get Request / Wsota/wsota_index.jsp, match all of its context6) Host matches the path to the path to / wsota (if you do not give the request to the path name " Context deduction) 7) Path = "/ wsota" Context get request / wsota_index.jsp, looking for the corresponding servlet8 in its mapping table) Context matches the servlet of the URL Pattern * .jsp, corresponding to the JSPSERVLET class 9) configuration HttpServletRequest object and HttpServletResponse objects, as calling JspServlet the doGet or doPost method 10) Context the HttpServletResponse object after execution of finished back to Host11) Host the HttpServletResponse object back to the Engine12) Engine the HttpServletResponse object back to the Connector13) Connector the HttpServletResponse object Return to the customer Browser

转载请注明原文地址:https://www.9cbs.com/read-71199.html

New Post(0)