SpringMVC中HandlerAdapter如何适配长尾请求路径?
- 内容介绍
- 文章标签
- 相关推荐
本文共计391个文字,预计阅读时间需要2分钟。
DispatcherServlet的initHandlerAdapters方法根据配置文件信息将HandlerAdapter注册到handlerAdapters(List)中。若配置文件中未配置,则默认读取DispatcherServlet.properties文件,该文件中配置了相应的设置。
DispatcherServlte的initHandlerAdapters方法根据配置文件信息把HandlerAdapter注册到handlerAdapters(List)中。
如果在配置文件中没有配置,默认配置会读取DispatcherServlte.properties文件,该文件中配置了三种HandlerAdapter:HttpRequestHandlerAdapter,SimpleControllerHandlerAdapter和AnnotationMethodHandlerAdapter。
SimpleControllerHandlerAdapter :继承Controller方式所使用的适配器 HttpRequestHandlerAdapter :HTTP请求处理器适配器 RequestMappingHandlerAdapter :注解方式(@Controller)的处理器适配器
getHandler方法根据请求遍历注册到handlerAdapters中的适配器拿到对应的适配器处理。
本文共计391个文字,预计阅读时间需要2分钟。
DispatcherServlet的initHandlerAdapters方法根据配置文件信息将HandlerAdapter注册到handlerAdapters(List)中。若配置文件中未配置,则默认读取DispatcherServlet.properties文件,该文件中配置了相应的设置。
DispatcherServlte的initHandlerAdapters方法根据配置文件信息把HandlerAdapter注册到handlerAdapters(List)中。
如果在配置文件中没有配置,默认配置会读取DispatcherServlte.properties文件,该文件中配置了三种HandlerAdapter:HttpRequestHandlerAdapter,SimpleControllerHandlerAdapter和AnnotationMethodHandlerAdapter。
SimpleControllerHandlerAdapter :继承Controller方式所使用的适配器 HttpRequestHandlerAdapter :HTTP请求处理器适配器 RequestMappingHandlerAdapter :注解方式(@Controller)的处理器适配器
getHandler方法根据请求遍历注册到handlerAdapters中的适配器拿到对应的适配器处理。

