Spring Web MVC
DispatcherServlet()
Special Bean Types (核心工作组件)
HandlerMapping
HandlerAdapter
org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
org.springframework.web.servlet.function.support.RouterFunctionMapping
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
org.springframework.web.servlet.function.support.HandlerFunctionAdapter
定义一个Handler的方法,第一种使用@RequestMapping
注解,第二种实现Controller
接口(这个接口很古老),第三种实现HttpRequestHandler
接口或者继承HttpServlet
以此创建一个servlet
用注解@RequestMapping
定义的Handler,用的是RequestMappingHandlerMapping
,其他两种,用的是BeanNameUrlHandlerMapping
,静态资源的请求,用的是SimpleUrlHandlerMapping
HandlerMapping
Annotated Controllers(基于注解)
Request Mapping
@RequestMapping