zoukankan      html  css  js  c++  java
  • Tomcat Server处理一个http请求过程

    假设来自客户端的请求为:

             http://localhost:8080/lizhx/lizhx_index.jsp

    1. 请求被发送到本机端口8080,被在那里侦听的Coyote HTTP/1.1 Connector获得。
    2. Connector把该请求交给它的Service的Engine来处理,并等待Engine的回应。
    3. Engine获得请求localhost/lizhx/lizhx_index.jsp,匹配所有虚拟主机Host。
    4. Engine匹配到名为localhost的Host。
    5. localhost Host获得请求/lizhx/lizhx_index.jsp,匹配它所拥有的所有Context。
    6. Host匹配到路径为/lizhx的Context。
    7. path = “/lizhx”的Context获得请求为/lizhx_index.jsp,在它的mapping table中寻找对应的Servlet。
    8. Context匹配到URL PATTERN为*.jsp的Servlet,对就于JspServlet类。
    9. 构造HttpServletRequest对象和HttpServletResponse对象,作为参数调用JspServlet的daGet或doPost方法。
    10. Context把执行完了之后的HttpServletResponse对象返回给Host。
    11. Host把HttpServletResponse对象返回给Engine。
    12. Engine把HttpServletResponse对象返回给Connector。
    13. Connector把HttpServletResponse对象返回给客户Browser。
  • 相关阅读:
    Redis入门(二)——基本操作
    Redis入门(一)——安装
    Switch按钮
    Vue入门(三)——模拟网络请求加载本地数据
    Vue入门(二)——Demo
    Vue入门(一)——环境搭建
    Oracle 存储过程
    函数节流
    jQuery实现瀑布流
    二分搜索法整理
  • 原文地址:https://www.cnblogs.com/hthuang/p/4389792.html
Copyright © 2011-2022 走看看