Package org.springframework.web.servlet.mvc.method.annotation

# Class RequestMappingHandlerAdapter

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter

All Implemented Interfaces:
  `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.BeanFactoryAware`, `org.springframework.beans.factory.InitializingBean`, `org.springframework.context.ApplicationContextAware`, `org.springframework.core.Ordered`, `org.springframework.web.context.ServletContextAware`, `HandlerAdapter`

public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
Extension of `AbstractHandlerMethodAdapter` that supports `@RequestMapping` annotated `HandlerMethods`.

Support for custom argument and return value types can be added via `setCustomArgumentResolvers(java.util.List<org.springframework.web.method.support.HandlerMethodArgumentResolver>)` and `setCustomReturnValueHandlers(java.util.List<org.springframework.web.method.support.HandlerMethodReturnValueHandler>)`, or alternatively, to re-configure all argument and return value types, use `setArgumentResolvers(java.util.List<org.springframework.web.method.support.HandlerMethodArgumentResolver>)` and `setReturnValueHandlers(java.util.List<org.springframework.web.method.support.HandlerMethodReturnValueHandler>)`.

Since:
  3.1
Author:
  Rossen Stoyanchev, Juergen Hoeller, Sebastien Deleuze
See Also:
  - `HandlerMethodArgumentResolver`
  - `HandlerMethodReturnValueHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final org.springframework.util.ReflectionUtils.MethodFilter`
`INIT_BINDER_METHODS`
MethodFilter that matches `@InitBinder` methods.
`static final org.springframework.util.ReflectionUtils.MethodFilter`
`MODEL_ATTRIBUTE_METHODS`
MethodFilter that matches `@ModelAttribute` methods.

### Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

`HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST`

### Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

`logger`

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`RequestMappingHandlerAdapter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`afterPropertiesSet()`
`protected org.springframework.web.method.annotation.InitBinderDataBinderFactory`
`createDataBinderFactory(List<org.springframework.web.method.support.InvocableHandlerMethod> binderMethods)`
Template method to create a new InitBinderDataBinderFactory instance.
`protected ServletInvocableHandlerMethod`
`createInvocableHandlerMethod(org.springframework.web.method.HandlerMethod handlerMethod)`
Create a `ServletInvocableHandlerMethod` from the given `HandlerMethod` definition.
`List<org.springframework.web.method.support.HandlerMethodArgumentResolver>`
`getArgumentResolvers()`
Return the configured argument resolvers, or possibly `null` if not initialized yet via `afterPropertiesSet()`.
`protected org.springframework.beans.factory.config.ConfigurableBeanFactory`
`getBeanFactory()`
Return the owning factory of this bean instance, or `null` if none.
`List<org.springframework.web.method.support.HandlerMethodArgumentResolver>`
`getCustomArgumentResolvers()`
Return the custom argument resolvers, or `null`.
`List<org.springframework.web.method.support.HandlerMethodReturnValueHandler>`
`getCustomReturnValueHandlers()`
Return the custom return value handlers, or `null`.
`List<org.springframework.web.ErrorResponse.Interceptor>`
`getErrorResponseInterceptors()`
Return the `configured` `ErrorResponse.Interceptor`'s.
`List<org.springframework.web.method.support.HandlerMethodArgumentResolver>`
`getInitBinderArgumentResolvers()`
Return the argument resolvers for `@InitBinder` methods, or possibly `null` if not initialized yet via `afterPropertiesSet()`.
`protected long`
`getLastModifiedInternal(HttpServletRequest request, org.springframework.web.method.HandlerMethod handlerMethod)`
This implementation always returns -1.
`List<org.springframework.http.converter.HttpMessageConverter<?>>`
`getMessageConverters()`
Return the configured message body converters.
`List<ModelAndViewResolver>`
`getModelAndViewResolvers()`
Return the configured `ModelAndViewResolvers`, or `null`.
`org.springframework.core.ReactiveAdapterRegistry`
`getReactiveAdapterRegistry()`
Return the configured reactive type registry of adapters.
`List<org.springframework.web.method.support.HandlerMethodReturnValueHandler>`
`getReturnValueHandlers()`
Return the configured handlers, or possibly `null` if not initialized yet via `afterPropertiesSet()`.
`org.springframework.web.bind.support.WebBindingInitializer`
`getWebBindingInitializer()`
Return the configured WebBindingInitializer, or `null` if none.
`protected ModelAndView`
`handleInternal(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod)`
Use the given handler method to handle the request.
`protected ModelAndView`
`invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod)`
Invoke the `RequestMapping` handler method preparing a `ModelAndView` if view resolution is required.
`void`
`setArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)`
Configure the complete list of supported argument types thus overriding the resolvers that would otherwise be configured by default.
`void`
`setAsyncRequestTimeout(long timeout)`
Specify the amount of time, in milliseconds, before concurrent handling should time out.
`void`
`setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)`
A `ConfigurableBeanFactory` is expected for resolving expressions in method argument default values.
`void`
`setCacheSecondsForSessionAttributeHandlers(int cacheSecondsForSessionAttributeHandlers)`
Cache content produced by `@SessionAttributes` annotated handlers for the given number of seconds.
`void`
`setCallableInterceptors(List<org.springframework.web.context.request.async.CallableProcessingInterceptor> interceptors)`
Configure `CallableProcessingInterceptor`'s to register on async requests.
`void`
`setContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager contentNegotiationManager)`
Set the `ContentNegotiationManager` to use to determine requested media types.
`void`
`setCustomArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)`
Provide resolvers for custom argument types.
`void`
`setCustomReturnValueHandlers(List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> returnValueHandlers)`
Provide handlers for custom return value types.
`void`
`setDeferredResultInterceptors(List<org.springframework.web.context.request.async.DeferredResultProcessingInterceptor> interceptors)`
Configure `DeferredResultProcessingInterceptor`'s to register on async requests.
`void`
`setErrorResponseInterceptors(List<org.springframework.web.ErrorResponse.Interceptor> interceptors)`
Configure a list of `ErrorResponse.Interceptor`'s to apply when rendering an RFC 9457 `ProblemDetail` error response.
`void`
`setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect)`
Deprecated.
as of 6.0 without a replacement; once removed, the default model will always be ignored on redirect
`void`
`setInitBinderArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)`
Configure the supported argument types in `@InitBinder` methods.
`void`
`setMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)`
Provide the converters to use in argument resolvers and return value handlers that support reading and/or writing to the body of the request and response.
`void`
`setModelAndViewResolvers(List<ModelAndViewResolver> modelAndViewResolvers)`
Provide custom `ModelAndViewResolvers`.
`void`
`setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer)`
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (for example, for default attribute names).
`void`
`setReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry reactiveAdapterRegistry)`
Configure the registry for reactive library types to be supported as return values from controller methods.
`void`
`setRequestBodyAdvice(List<RequestBodyAdvice> requestBodyAdvice)`
Add one or more `RequestBodyAdvice` instances to intercept the request before it is read and converted for `@RequestBody` and `HttpEntity` method arguments.
`void`
`setResponseBodyAdvice(List<ResponseBodyAdvice<?>> responseBodyAdvice)`
Add one or more `ResponseBodyAdvice` instances to intercept the response before `@ResponseBody` or `ResponseEntity` return values are written to the response body.
`void`
`setReturnValueHandlers(List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> returnValueHandlers)`
Configure the complete list of supported return value types thus overriding handlers that would otherwise be configured by default.
`void`
`setSessionAttributeStore(org.springframework.web.bind.support.SessionAttributeStore sessionAttributeStore)`
Specify the strategy to store session attributes with.
`void`
`setSynchronizeOnSession(boolean synchronizeOnSession)`
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.
`void`
`setTaskExecutor(org.springframework.core.task.AsyncTaskExecutor taskExecutor)`
Set the default `AsyncTaskExecutor` to use when a controller method return a `Callable`.
`void`
`setWebBindingInitializer(org.springframework.web.bind.support.WebBindingInitializer webBindingInitializer)`
Provide a WebBindingInitializer with "global" initialization to apply to every DataBinder instance.
`protected boolean`
`supportsInternal(org.springframework.web.method.HandlerMethod handlerMethod)`
Always return `true` since any method argument and return value type will be processed in some way.

### Methods inherited from class org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter

`getLastModified, getOrder, handle, setOrder, supports`

### Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

`applyCacheControl, applyCacheSeconds, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setVaryByRequestHeaders`

### Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

`getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext`

### Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

`getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### INIT_BINDER_METHODS

public static final org.springframework.util.ReflectionUtils.MethodFilter INIT_BINDER_METHODS
MethodFilter that matches `@InitBinder` methods.

### MODEL_ATTRIBUTE_METHODS

public static final org.springframework.util.ReflectionUtils.MethodFilter MODEL_ATTRIBUTE_METHODS
MethodFilter that matches `@ModelAttribute` methods.

## Constructor Details

### RequestMappingHandlerAdapter

public RequestMappingHandlerAdapter()

## Method Details

### setCustomArgumentResolvers

public void setCustomArgumentResolvers(@Nullable List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)
Provide resolvers for custom argument types. Custom resolvers are ordered after built-in ones. To override the built-in support for argument resolution use `setArgumentResolvers(java.util.List<org.springframework.web.method.support.HandlerMethodArgumentResolver>)` instead.

### getCustomArgumentResolvers

@Nullable public List<org.springframework.web.method.support.HandlerMethodArgumentResolver> getCustomArgumentResolvers()
Return the custom argument resolvers, or `null`.

### setArgumentResolvers

public void setArgumentResolvers(@Nullable List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)
Configure the complete list of supported argument types thus overriding the resolvers that would otherwise be configured by default.

### getArgumentResolvers

@Nullable public List<org.springframework.web.method.support.HandlerMethodArgumentResolver> getArgumentResolvers()
Return the configured argument resolvers, or possibly `null` if not initialized yet via `afterPropertiesSet()`.

### setInitBinderArgumentResolvers

public void setInitBinderArgumentResolvers(@Nullable List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)
Configure the supported argument types in `@InitBinder` methods.

### getInitBinderArgumentResolvers

@Nullable public List<org.springframework.web.method.support.HandlerMethodArgumentResolver> getInitBinderArgumentResolvers()
Return the argument resolvers for `@InitBinder` methods, or possibly `null` if not initialized yet via `afterPropertiesSet()`.

### setCustomReturnValueHandlers

public void setCustomReturnValueHandlers(@Nullable List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> returnValueHandlers)
Provide handlers for custom return value types. Custom handlers are ordered after built-in ones. To override the built-in support for return value handling use `setReturnValueHandlers(java.util.List<org.springframework.web.method.support.HandlerMethodReturnValueHandler>)`.

### getCustomReturnValueHandlers

@Nullable public List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> getCustomReturnValueHandlers()
Return the custom return value handlers, or `null`.

### setReturnValueHandlers

public void setReturnValueHandlers(@Nullable List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> returnValueHandlers)
Configure the complete list of supported return value types thus overriding handlers that would otherwise be configured by default.

### getReturnValueHandlers

@Nullable public List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> getReturnValueHandlers()
Return the configured handlers, or possibly `null` if not initialized yet via `afterPropertiesSet()`.

### setModelAndViewResolvers

public void setModelAndViewResolvers(@Nullable List<ModelAndViewResolver> modelAndViewResolvers)
Provide custom `ModelAndViewResolvers`.

Note: This method is available for backwards compatibility only. However, it is recommended to re-write a `ModelAndViewResolver` as `HandlerMethodReturnValueHandler`. An adapter between the two interfaces is not possible since the `HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)` method cannot be implemented. Hence `ModelAndViewResolver`s are limited to always being invoked at the end after all other return value handlers have been given a chance.

A `HandlerMethodReturnValueHandler` provides better access to the return type and controller method information and can be ordered freely relative to other return value handlers.

### getModelAndViewResolvers

@Nullable public List<ModelAndViewResolver> getModelAndViewResolvers()
Return the configured `ModelAndViewResolvers`, or `null`.

### setContentNegotiationManager

public void setContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager contentNegotiationManager)
Set the `ContentNegotiationManager` to use to determine requested media types. If not set, the default constructor is used.

### setMessageConverters

public void setMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)
Provide the converters to use in argument resolvers and return value handlers that support reading and/or writing to the body of the request and response.

### getMessageConverters

public List<org.springframework.http.converter.HttpMessageConverter<?>> getMessageConverters()
Return the configured message body converters.

### setRequestBodyAdvice

public void setRequestBodyAdvice(@Nullable List<RequestBodyAdvice> requestBodyAdvice)
Add one or more `RequestBodyAdvice` instances to intercept the request before it is read and converted for `@RequestBody` and `HttpEntity` method arguments.

### setResponseBodyAdvice

public void setResponseBodyAdvice(@Nullable List<ResponseBodyAdvice<?>> responseBodyAdvice)
Add one or more `ResponseBodyAdvice` instances to intercept the response before `@ResponseBody` or `ResponseEntity` return values are written to the response body.

### setWebBindingInitializer

public void setWebBindingInitializer(@Nullable org.springframework.web.bind.support.WebBindingInitializer webBindingInitializer)
Provide a WebBindingInitializer with "global" initialization to apply to every DataBinder instance.

### getWebBindingInitializer

@Nullable public org.springframework.web.bind.support.WebBindingInitializer getWebBindingInitializer()
Return the configured WebBindingInitializer, or `null` if none.

### setErrorResponseInterceptors

public void setErrorResponseInterceptors(List<org.springframework.web.ErrorResponse.Interceptor> interceptors)
Configure a list of `ErrorResponse.Interceptor`'s to apply when rendering an RFC 9457 `ProblemDetail` error response.

Parameters:
  `interceptors` - the interceptors to use
Since:
  6.2

### getErrorResponseInterceptors

public List<org.springframework.web.ErrorResponse.Interceptor> getErrorResponseInterceptors()
Return the `configured` `ErrorResponse.Interceptor`'s.

Since:
  6.2

### setTaskExecutor

public void setTaskExecutor(org.springframework.core.task.AsyncTaskExecutor taskExecutor)
Set the default `AsyncTaskExecutor` to use when a controller method return a `Callable`. Controller methods can override this default on a per-request basis by returning an `WebAsyncTask`.

If your application has controllers with such return types, please configure an `AsyncTaskExecutor` as the one used by default is not suitable for production under load.

### setAsyncRequestTimeout

public void setAsyncRequestTimeout(long timeout)
Specify the amount of time, in milliseconds, before concurrent handling should time out. In Servlet 3, the timeout begins after the main request processing thread has exited and ends when the request is dispatched again for further processing of the concurrently produced result.

If this value is not set, the default timeout of the underlying implementation is used.

Parameters:
  `timeout` - the timeout value in milliseconds

### setCallableInterceptors

public void setCallableInterceptors(List<org.springframework.web.context.request.async.CallableProcessingInterceptor> interceptors)
Configure `CallableProcessingInterceptor`'s to register on async requests.

Parameters:
  `interceptors` - the interceptors to register

### setDeferredResultInterceptors

public void setDeferredResultInterceptors(List<org.springframework.web.context.request.async.DeferredResultProcessingInterceptor> interceptors)
Configure `DeferredResultProcessingInterceptor`'s to register on async requests.

Parameters:
  `interceptors` - the interceptors to register

### setReactiveAdapterRegistry

public void setReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry reactiveAdapterRegistry)
Configure the registry for reactive library types to be supported as return values from controller methods.

Since:
  5.0.5

### getReactiveAdapterRegistry

public org.springframework.core.ReactiveAdapterRegistry getReactiveAdapterRegistry()
Return the configured reactive type registry of adapters.

Since:
  5.0

### setIgnoreDefaultModelOnRedirect

@Deprecated(since="6.0") public void setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect)
Deprecated.
as of 6.0 without a replacement; once removed, the default model will always be ignored on redirect
By default, the content of the "default" model is used both during rendering and redirect scenarios. Alternatively a controller method can declare a `RedirectAttributes` argument and use it to provide attributes for a redirect.

Setting this flag to `true` guarantees the "default" model is never used in a redirect scenario even if a RedirectAttributes argument is not declared. Setting it to `false` means the "default" model may be used in a redirect if the controller method doesn't declare a RedirectAttributes argument.

As of 6.0, this property is set to `true` by default.

See Also:
  - `RedirectAttributes`

### setSessionAttributeStore

public void setSessionAttributeStore(org.springframework.web.bind.support.SessionAttributeStore sessionAttributeStore)
Specify the strategy to store session attributes with. The default is `DefaultSessionAttributeStore`, storing session attributes in the HttpSession with the same attribute name as in the model.

### setCacheSecondsForSessionAttributeHandlers

public void setCacheSecondsForSessionAttributeHandlers(int cacheSecondsForSessionAttributeHandlers)
Cache content produced by `@SessionAttributes` annotated handlers for the given number of seconds.

Possible values are:

- -1: no generation of cache-related headers
- 0 (default value): "Cache-Control: no-store" will prevent caching
- 1 or higher: "Cache-Control: max-age=seconds" will ask to cache content; not advised when dealing with session attributes

In contrast to the "cacheSeconds" property which will apply to all general handlers (but not to `@SessionAttributes` annotated handlers), this setting will apply to `@SessionAttributes` handlers only.

See Also:
  - `WebContentGenerator.setCacheSeconds(int)`
  - `SessionAttributes`

### setSynchronizeOnSession

public void setSynchronizeOnSession(boolean synchronizeOnSession)
Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.

More specifically, the execution of the `handleRequestInternal` method will get synchronized if this flag is "true". The best available session mutex will be used for the synchronization; ideally, this will be a mutex exposed by HttpSessionMutexListener.

The session mutex is guaranteed to be the same object during the entire lifetime of the session, available under the key defined by the `SESSION_MUTEX_ATTRIBUTE` constant. It serves as a safe reference to synchronize on for locking on the current session.

In many cases, the HttpSession reference itself is a safe mutex as well, since it will always be the same object reference for the same active logical session. However, this is not guaranteed across different servlet containers; the only 100% safe way is a session mutex.

See Also:
  - `HttpSessionMutexListener`
  - `WebUtils.getSessionMutex(jakarta.servlet.http.HttpSession)`

### setParameterNameDiscoverer

public void setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (for example, for default attribute names).

Default is a `DefaultParameterNameDiscoverer`.

### setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
A `ConfigurableBeanFactory` is expected for resolving expressions in method argument default values.

Specified by:
  `setBeanFactory` in interface `org.springframework.beans.factory.BeanFactoryAware`

### getBeanFactory

@Nullable protected org.springframework.beans.factory.config.ConfigurableBeanFactory getBeanFactory()
Return the owning factory of this bean instance, or `null` if none.

### afterPropertiesSet

public void afterPropertiesSet()

Specified by:
  `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`

### supportsInternal

protected boolean supportsInternal(org.springframework.web.method.HandlerMethod handlerMethod)
Always return `true` since any method argument and return value type will be processed in some way. A method argument not recognized by any HandlerMethodArgumentResolver is interpreted as a request parameter if it is a simple type, or as a model attribute otherwise. A return value not recognized by any HandlerMethodReturnValueHandler will be interpreted as a model attribute.

Specified by:
  `supportsInternal` in class `AbstractHandlerMethodAdapter`
Parameters:
  `handlerMethod` - the handler method to check
Returns:
  whether this adapter can adapt the given method

### handleInternal

@Nullable protected ModelAndView handleInternal(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod) throws Exception
Description copied from class: `AbstractHandlerMethodAdapter`
Use the given handler method to handle the request.

Specified by:
  `handleInternal` in class `AbstractHandlerMethodAdapter`
Parameters:
  `request` - current HTTP request
  `response` - current HTTP response
  `handlerMethod` - handler method to use. This object must have previously been passed to the `AbstractHandlerMethodAdapter.supportsInternal(HandlerMethod)` this interface, which must have returned `true`.
Returns:
  a ModelAndView object with the name of the view and the required model data, or `null` if the request has been handled directly
Throws:
  `Exception` - in case of errors

### getLastModifiedInternal

protected long getLastModifiedInternal(HttpServletRequest request, org.springframework.web.method.HandlerMethod handlerMethod)
This implementation always returns -1. An `@RequestMapping` method can calculate the lastModified value, call `WebRequest.checkNotModified(long)`, and return `null` if the result of that call is `true`.

Specified by:
  `getLastModifiedInternal` in class `AbstractHandlerMethodAdapter`
Parameters:
  `request` - current HTTP request
  `handlerMethod` - handler method to use
Returns:
  the lastModified value for the given handler

### invokeHandlerMethod

@Nullable protected ModelAndView invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, org.springframework.web.method.HandlerMethod handlerMethod) throws Exception
Invoke the `RequestMapping` handler method preparing a `ModelAndView` if view resolution is required.

Throws:
  `Exception`
Since:
  4.2
See Also:
  - `createInvocableHandlerMethod(HandlerMethod)`

### createInvocableHandlerMethod

protected ServletInvocableHandlerMethod createInvocableHandlerMethod(org.springframework.web.method.HandlerMethod handlerMethod)
Create a `ServletInvocableHandlerMethod` from the given `HandlerMethod` definition.

Parameters:
  `handlerMethod` - the `HandlerMethod` definition
Returns:
  the corresponding `ServletInvocableHandlerMethod` (or custom subclass thereof)
Since:
  4.2

### createDataBinderFactory

protected org.springframework.web.method.annotation.InitBinderDataBinderFactory createDataBinderFactory(List<org.springframework.web.method.support.InvocableHandlerMethod> binderMethods) throws Exception
Template method to create a new InitBinderDataBinderFactory instance.

The default implementation creates a ServletRequestDataBinderFactory. This can be overridden for custom ServletRequestDataBinder subclasses.

Parameters:
  `binderMethods` - `@InitBinder` methods
Returns:
  the InitBinderDataBinderFactory instance to use
Throws:
  `Exception` - in case of invalid state or arguments