SpringMVC流程
2021-04-07 21:20:09 2 举报
SpringMVC的运行流程
作者其他创作
大纲/内容
BeanNameViewResolverContentNegotiatingViewResolver 内容协商(根据客户提交的MimeType决定返回的数据)InternalResourceViewResolver 内部资源(jsp)AbstractTemplateViewResolver FreeMarker等模板
HandlerMapping
doService --> doDispatch 方法完成整个调用流程 (默认配置: DispatcherServlet.properties)
View
SimpleUrlHandlerMapping 手动配置BeanNameUrlHandlerMapping beanName以/开头RequestMappingHandlerMapping 最常用的@RequestMapping注解方法RouterFunctionMapping Spring5.2新增
DispatcherServlet
HandlerAdapter
ViewResolver
SimpleServletHandlerAdapter 适配 Servlet的service方法SimpleControllerHandlerAdapter 适配 Controller的handleRequest方法HttpRequestHandlerAdapter 适配 HttpRequestHandlerAdapter的handleRequest方法RequestMappingHandlerAdapter 适配 @RequestMapping注解的HandlerMethod (最常用)HandlerFunctionAdapter 适配 HandlerFunction (Spring5.2新增)
InternalResourceViewMappingJackson2JsonViewFreeMarkerViewAbstractXlsxView
HandlerExecutionChain getHandler(HttpServletRequest request)
Handler
0 条评论
回复 删除
下一页