Package org.springframework.web.servlet.mvc.method.annotation
@NonNullApi
@NonNullFields
package org.springframework.web.servlet.mvc.method.annotation
MVC infrastructure for annotation-based handler method processing, building on the
org.springframework.web.method.annotation package. Entry points are
RequestMappingHandlerMapping
and RequestMappingHandlerAdapter.-
ClassDescriptionA convenient base class for
ResponseBodyAdviceimplementations that customize the response before JSON serialization withAbstractJackson2HttpMessageConverter's concrete subclasses.A base class for resolving method argument values by reading from the body of a request withHttpMessageConverters.ExtendsAbstractMessageConverterMethodArgumentResolverwith the ability to handle method return values by writing to the response withHttpMessageConverters.Handles return values of typeWebAsyncTask.Handles return values of typeCallable.No-op resolver for method arguments of typeContinuation.AnAbstractHandlerMethodExceptionResolverthat resolves exceptions through@ExceptionHandlermethods.Subclass ofServletRequestDataBinderthat adds URI template variables to the values used for data binding.ResolvesHttpEntityandRequestEntitymethod argument values, as well as return values of typeHttpEntity,ResponseEntity,ErrorResponseandProblemDetail.HandlesHttpHeadersreturn values.ARequestBodyAdviceimplementation that adds support for Jackson's@JsonViewannotation declared on a Spring MVC@HttpEntityor@RequestBodymethod parameter.AResponseBodyAdviceimplementation that adds support for Jackson's@JsonViewannotation declared on a Spring MVC@RequestMappingor@ExceptionHandlermethod.Resolves arguments of typeMapannotated with@MatrixVariablewhere the annotation does not specify a name.Resolves arguments annotated with@MatrixVariable.Handles return values of typeModelAndViewcopying view and model information to theModelAndViewContainer.This return value handler is intended to be ordered after all others as it attempts to handle _any_ return value type (i.e.Creates instances ofUriComponentsBuilderby pointing to@RequestMappingmethods on Spring MVC controllers.Builder class to create URLs for method arguments.Method invocation information.ResolvesMapmethod arguments annotated with@PathVariablewhere the annotation does not specify a path variable name.Resolves method arguments annotated with an @PathVariable.Resolves an argument of typePrincipal, similar toServletRequestMethodArgumentResolverbut irrespective of whether the argument is annotated or not.Resolves method arguments of typeRedirectAttributes.Resolves method arguments annotated with an @RequestAttribute.Allows customizing the request before its body is read and converted into an Object and also allows for processing of the resulting Object before it is passed into a controller method as an@RequestBodyor anHttpEntitymethod argument.A convenient starting point for implementingRequestBodyAdvicewith default method implementations.CreatesRequestMappingInfoinstances from type and method-level@RequestMappingannotations in@Controllerclasses.Resolves the following method arguments: Annotated with @RequestPartOf typeMultipartFilein conjunction with Spring'sMultipartResolverabstraction Of typejakarta.servlet.http.Partin conjunction with Servlet multipart requestsResolves method arguments annotated with@RequestBodyand handles return values from methods annotated with@ResponseBodyby reading and writing to the body of the request or response with anHttpMessageConverter.Allows customizing the response after the execution of an@ResponseBodyor aResponseEntitycontroller method but before the body is written with anHttpMessageConverter.A controller method return value type for asynchronous request processing where one or more objects are written to the response.A simple holder of data to be written along with a MediaType hint for selecting a message converter to write with.Handler for return values of typeResponseBodyEmitterand subclasses such asSseEmitterincluding the same types wrapped withResponseEntity.A class with an@ExceptionHandlermethod that handles all Spring MVC raised exceptions by returning aResponseEntitywith RFC 7807 formatted error details in the body.AnAbstractCookieValueMethodArgumentResolverthat resolves cookie values from anHttpServletRequest.ExtendsInvocableHandlerMethodwith the ability to handle return values through a registeredHandlerMethodReturnValueHandlerand also supports setting the response status based on a method-level@ResponseStatusannotation.A Servlet-specificModelAttributeMethodProcessorthat applies data binding through a WebDataBinder of typeServletRequestDataBinder.Creates aServletRequestDataBinder.Resolves servlet backed request-related method arguments.Resolves servlet backed response-related method arguments.A Servlet-specificAbstractWebArgumentResolverAdapterthat creates aNativeWebRequestfromServletRequestAttributes.Resolves method arguments annotated with an @SessionAttribute.A specialization ofResponseBodyEmitterfor sending Server-Sent Events.A builder for an SSE event.A controller method return value type for asynchronous request processing where the application can write directly to the responseOutputStreamwithout holding up the Servlet container thread.Supports return values of typeStreamingResponseBodyand alsoResponseEntity<StreamingResponseBody>.Resolvers argument values of typeUriComponentsBuilder.Handles return values that are of typeView.Handles return values of typesvoidandStringinterpreting them as view name reference.