在获取HandlerMethodAdapter适配器之后, 调用适配器的handle()方法执行处理器, 也就是Control类中我们编写的处理方法
AbstractHandlerMethodAdapter#handle()方法实现:
@Override
@Nullable
public final ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
/**
* Spring默认处理适配器为:RequestMappingHandlerAdapter(注解处理器适配器)
* {@link RequestMappingHandlerAdapter#handleInternal(HttpServletRequest,HttpServletResponse,HandlerMethod)}
*/
return handleInternal(request, response, (HandlerMethod) handler);
}
AbstractHandlerMethodAdapter为RequestMappingHandlerAdapter的父类
RequestMappingHandlerAdapter#handleInternal()方法实现:
@Override
protected ModelAndView handleInternal(HttpServletRequest request,
HttpServletResponse response, HandlerMethod handlerMethod) throws Exception {
ModelAndView mav;