Spring MVC框架模型
2018-11-16 10:41:14 0 举报
spring mvc流程图
作者其他创作
大纲/内容
HandlerInterceptor.afterCompletion
RequestMappingHandlerAdapter
https://www.cnblogs.com/fangjian0423/p/springMVC-exception-analysis.html
优先级最低:2
RequestMappingHandlerMapping
如下三种方式都能实例HttpRequestHandlerAdapter:
4.5渲染render
HttpMessageConverter
优先级最高:0
DispatcherServlet
优先级也最高:0
4.4processDispatchResult
writeWithMessageConverters
HandlerMapping
readWithMessageConverters
ViewResolver
4.1拦截器前处理
ExceptionHandlerExceptionResolver@ExceptionHandler@ControllerAdvice
HandlerInterceptor.preHandle
DefaultServletHttpRequestHandler
自定义HandlerExceptionResolver
urlMap.put(\"/**\
View
getMethodArgumentValues
具有Controller注解的类
4.6triggerAfterCompletion
HandlerExceptionResolver
HandlerMethodReturnValueHandler
doInvoke
DefaultHandlerExceptionResolver
HandlerExecutionChain getHandler(HttpServletRequest request)
ResponseStatusExceptionResolver
优先级其次:1
Handler(Controller)
HandlerInterceptor.postHandle
HandlerMethodArgumentResolver
ModelAndView存在
ResourceHttpRequestHandler
默认优先级最低:Ordered.LOWEST_PRECEDENCE - 1
Exception存在
HandlerAdapter
SimpleUrlHandlerMapping
4.3拦截器前处理
-servlet.xml
具有RequestMapping注解的类
String resourceRequestPath = element.getAttribute(\"mapping\
HttpRequestHandlerAdapter
4.2请求适配器执行
4.2返回ModelAndView
4.4返回View
优先级:0最高
handleReturnValue
收藏
收藏
0 条评论
下一页