Skip to content

HandlerAdapter

HandlerAdapter is a component within the Spring MVC framework that acts as a bridge between the DispatcherServlet and the actual handler (the controller) processing the request.^[600-developer__java__spring__DispatcherServlet.md]

It functions as an adapter for the HTTP request handler, allowing the DispatcherServlet to invoke handlers regardless of the specific interface they implement.^[600-developer__java__spring__DispatcherServlet.md]

Implementations

The framework provides several concrete implementations of the HandlerAdapter interface to support different types of handlers:

  • HttpRequestHandlerAdapter: Designed to handle handlers that implement the HttpRequestHandler interface^[600-developer__java__spring__DispatcherServlet.md].
  • SimpleControllerHandlerAdapter: Designed to handle handlers that implement the Controller interface^[600-developer__java__spring__DispatcherServlet.md].
  • RequestMappingHandlerAdapter: Supports annotated controllers, typically those using the @RequestMapping annotation^[600-developer__java__spring__DispatcherServlet.md].
  • [[HttpRequestHandler]]
  • [[Controller]]

Sources

  • 600-developer__java__spring__DispatcherServlet.md