zoukankan      html  css  js  c++  java
  • 理解Tomcat

    Tomcat架构

    Tomcat处理请求过程

    1、用户访问http://localhost:8080/test/index.jsp,被监听8080端口并处理 HTTP/1.0 协议的的Connector获得;
    2、Connector把该请求交给它所在的Service的Engine来处理,并等待Engine的回应;
    3、Engine获得请求localhost/test/index.jsp ,匹配所有Host;
    4、Engine 匹配到localhost的Host 虚拟主机来处理 /test/index.jsp请求(即使匹配不到也会交给默认的Host 来处理),
    Host会根据/test 匹配它所拥有的所有Context。
    5、匹配到的Context获得请求 /index.jsp;
    6、够着HttpServletRequest 对象和HttpServletRespose对象,作为参数调用jspServelt的doGet()或doPost()
    执行业务逻辑、数据存储等程序;
    7、Context 把执行完的结果通过 HTTPServletResponse对象返回给Host;
    8、Host 把HTTPServletResponse 返回给Engine;
    9、Engine 把 HTTPServletResponse 返回给 Connector;
    10、Connector 把 HTTPServletResponse 返回给 Browser。

    重视基础,才能走的更远。
  • 相关阅读:
    java-线程(一)
    Lucene小例子
    Oracle在Java中事物管理
    sort quick
    static静态数据的初始化
    正则表达式30分钟入门教程
    div遮罩弹框口
    EL表达式
    LeetCode: Invert Binary Tree
    LeetCode: Find the Difference
  • 原文地址:https://www.cnblogs.com/xzlf/p/13054337.html
Copyright © 2011-2022 走看看