下文笔者讲述Tomcat请求处理流程简介说明,如下所示
例:
访问:http://localhost:8090/testDemo/index.jsp
例:
访问:http://localhost:8090/testDemo/index.jsp
1. 请求发送给本机8090,被在那里监听HTTP/Connector获得
2. Connector将该请求发给它本身所在Service所在的Engine来处理,
并等待Engine来回应
3. Engine匹配对应的Host和Context,
并将请求交给对应的Servlet
4. 构造HttpServletRequest对象
和HttpServletResponse对象作为参数,
调用Servlet的doGet()方法和doPost()方法.
5. Context把执行完后的HttpServletResponse对象返回给Host,
再返回给Engine,Connector
6. Connector把HttpServletResponse对象返回
给浏览器的Browser
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。


