SpringMVC之HandlerAdapter执行流程
2021-07-03 11:06
01.
protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception {
HandlerAdapter ha = this.getHandlerAdapter(mappedHandler.getHandler());
ha = (HandlerAdapter)var2.next();
}02.
protected HandlerAdapter getHandlerAdapter(Object handler) throws ServletException {
Iterator var2 = this.handlerAdapters.iterator();HandlerAdapter ha;
do {
if (!var2.hasNext()) {
throw new ServletException("No adapter for handler [" + handler + "]: The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler");
}ha = (HandlerAdapter)var2.next();
if (this.logger.isTraceEnabled()) {
this.logger.trace("Testing handler adapter [" + ha + "]");
}
} while(!ha.supports(handler));return ha;
}03.
mv = ha.handle(processedRequest, response, mappedHandler.getHandler());
public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
return ((Controller)handler).handleRequest(request, response);
}04.自定义的Controller
上一篇:python中线程和进程相关
下一篇:python的第五天
文章标题:SpringMVC之HandlerAdapter执行流程
文章链接:http://soscw.com/essay/101239.html