[[mvc-servlet-special-bean-types]]
= Special Bean Types

[.small]#xref:web/webflux/dispatcher-handler.adoc#webflux-special-bean-types[See equivalent in the Reactive stack]#

The `DispatcherServlet` delegates to special beans to process requests and render the
appropriate responses. By "`special beans`" we mean Spring-managed `Object` instances that
implement framework contracts. Those usually come with built-in contracts, but
you can customize their properties and extend or replace them.

The following table lists the special beans detected by the `DispatcherServlet`:

[[mvc-webappctx-special-beans-tbl]]
[cols="1,2", options="header"]
|===
| Bean type| Explanation

| `HandlerMapping`
| Map a request to a handler along with a list of
  xref:web/webmvc/mvc-servlet/handlermapping-interceptor.adoc[interceptors] for pre- and post-processing.
  The mapping is based on some criteria, the details of which vary by `HandlerMapping`
  implementation.

  The two main `HandlerMapping` implementations are `RequestMappingHandlerMapping`
  (which supports `@RequestMapping` annotated methods) and `SimpleUrlHandlerMapping`
  (which maintains explicit registrations of URI path patterns to handlers).

| `HandlerAdapter`
| Help the `DispatcherServlet` to invoke a handler mapped to a request, regardless of
  how the handler is actually invoked. For example, invoking an annotated controller
  requires resolving annotations. The main purpose of a `HandlerAdapter` is
  to shield the `DispatcherServlet` from such details.

| xref:web/webmvc/mvc-servlet/exceptionhandlers.adoc[`HandlerExceptionResolver`]
| Strategy to resolve exceptions, possibly mapping them to handlers, to HTML error
  views, or other targets. See xref:web/webmvc/mvc-servlet/exceptionhandlers.adoc[Exceptions].

| xref:web/webmvc/mvc-servlet/viewresolver.adoc[`ViewResolver`]
| Resolve logical `String`-based view names returned from a handler to an actual `View`
  with which to render to the response. See xref:web/webmvc/mvc-servlet/viewresolver.adoc[View Resolution] and xref:web/webmvc-view.adoc[View Technologies].

| xref:web/webmvc/mvc-servlet/localeresolver.adoc[`LocaleResolver`], xref:web/webmvc/mvc-servlet/localeresolver.adoc#mvc-timezone[LocaleContextResolver]
| Resolve the `Locale` a client is using and possibly their time zone, in order to be able
  to offer internationalized views. See xref:web/webmvc/mvc-servlet/localeresolver.adoc[Locale].

| xref:web/webmvc/mvc-servlet/themeresolver.adoc[`ThemeResolver`]
| Resolve themes your web application can use -- for example, to offer personalized layouts.
  See xref:web/webmvc/mvc-servlet/themeresolver.adoc[Themes].

| xref:web/webmvc/mvc-servlet/multipart.adoc[`MultipartResolver`]
| Abstraction for parsing a multi-part request (for example, browser form file upload) with
  the help of some multipart parsing library. See xref:web/webmvc/mvc-servlet/multipart.adoc[Multipart Resolver].

| xref:web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc[`FlashMapManager`]
| Store and retrieve the "`input`" and the "`output`" `FlashMap` that can be used to pass
  attributes from one request to another, usually across a redirect.
  See xref:web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc[Flash Attributes].
|===



