请求由tomcat转到servlet的临界点

 1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>StandardWrapperValve--->Servlet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 2    请求转出,都由valve来调用servlet的service方法
 3    [1] 直接转出
 4    StandardWrapperValve
 5    void java.org.apache.catalina.core.StandardWrapperValve.invoke(Request request, Response response) throws IOException, ServletException
 6    --->filterChain.doFilter
 7    ------------>servlet.service(request, response);
 8       
 9    [2] 内部循环再转出
10    -------->((AsyncContextImpl)request.getAsyncContext()).doInternalDispatch();
11           ----> void java.org.apache.catalina.core.AsyncContextImpl.doInternalDispatch() throws ServletException, IOException
12                ----> 
13                         Runnable runnable = dispatch;
14                         dispatch = null;
15                         runnable.run();
16                         
17                         ------------->
18                          void java.org.apache.catalina.core.AsyncContextImpl.dispatch(ServletContext context, String path)
19                                 ---->applicationDispatcher.dispatch(servletRequest, servletResponse);
20                                 
21                                 
22                                 AsyncDispatcher=applicationDispatcher
23 
24                                 final class ApplicationDispatcher implements AsyncDispatcher, RequestDispatcher
25 
26                                 ------>final class ApplicationDispatcher implements AsyncDispatcher, RequestDispatcher
27                                         ---------> void java.org.apache.catalina.core.ApplicationDispatcher.doDispatch(ServletRequest request, ServletResponse response) throws ServletException, IOException
28                                                    -------------> void java.org.apache.catalina.core.ApplicationDispatcher.doDispatch(ServletRequest request, ServletResponse response) throws ServletException, IOException
29                                                                 //Servlet Service Method is called by the FilterChain
30                                                                   ----------->void java.org.apache.catalina.core.ApplicationFilterChain.doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException
31                                                                      --> void java.org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException
32                                                                             ------------>servlet.service(request, response);
33     最终都是由servlet.service(request, response);                                                        
34 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>StandardWrapperValve--->Servlet>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
35    
36    

 

posted on 2014-10-29 09:46  rojas  阅读(288)  评论(0编辑  收藏  举报