@RequestBody and handles return
values from methods annotated with @ResponseBody by reading and writing
to the body of the request or response with an HttpMessageConverter.
An @RequestBody method argument is also validated if it is annotated
with any
annotations that trigger validation. In case of validation failure,
MethodArgumentNotValidException is raised and results in an HTTP 400
response status code if DefaultHandlerExceptionResolver is configured.
| Access | Constructor and Description |
|---|---|
| public | RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters)
Basic constructor with converters only. |
| public | RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager manager)
Basic constructor with converters and |
| public | RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters, List<Object> requestResponseBodyAdvice)
Complete constructor for resolving |
| public | RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager manager, List<Object> requestResponseBodyAdvice)
Complete constructor for resolving |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| public void | handleReturnValue(Object
the value returned from the handler method returnValue, MethodParameter the type of the return value. This type must have
previously been passed to returnType, ModelAndViewContainer supportsReturnType which must
have returned true.the ModelAndViewContainer for the current request mavContainer, NativeWebRequest the current request webRequest)Implements org. Handle the given return value by adding attributes to the model and
setting a view or setting the
|
| protected <T> Object | readWithMessageConverters(NativeWebRequest
the current request webRequest, MethodParameter the method parameter descriptor (may be parameter, Type null)the type of the argument value to be created paramType)
Create the method argument value of the expected parameter type by reading from the given request. |
| public Object | resolveArgument(MethodParameter
the method parameter to resolve. This parameter must
have previously been passed to parameter, ModelAndViewContainer supportsParameter which must
have returned true.the ModelAndViewContainer for the current request mavContainer, NativeWebRequest the current request webRequest, WebDataBinderFactory a factory for creating binderFactory)WebDataBinder instancesImplements org. Throws MethodArgumentNotValidException if validation fails. |
| public boolean | supportsParameter(MethodParameter
the method parameter to check parameter)Implements org. Whether the given method parameter is supported by this resolver. |
| public boolean | supportsReturnType(MethodParameter
the method return type to check returnType)Implements org. Whether the given method return type is supported by this handler. |
| RequestResponseBodyMethodProcessor | back to summary |
|---|---|
| public RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters) Basic constructor with converters only. Suitable for resolving
| |
| RequestResponseBodyMethodProcessor | back to summary |
|---|---|
| public RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager manager) Basic constructor with converters and | |
| RequestResponseBodyMethodProcessor | back to summary |
|---|---|
| public RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters, List<Object> requestResponseBodyAdvice) Complete constructor for resolving
| |
| RequestResponseBodyMethodProcessor | back to summary |
|---|---|
| public RequestResponseBodyMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager manager, List<Object> requestResponseBodyAdvice) Complete constructor for resolving | |
| checkRequired | back to summary |
|---|---|
| protected boolean checkRequired(MethodParameter parameter) | |
| handleReturnValue | back to summary |
|---|---|
| public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws IOException, HttpMediaTypeNotAcceptableException, HttpMessageNotWritableException Implements org. Doc from org. Handle the given return value by adding attributes to the model and
setting a view or setting the
| |
| readWithMessageConverters | back to summary |
|---|---|
| protected <T> Object readWithMessageConverters(NativeWebRequest webRequest, MethodParameter parameter, Type paramType) throws IOException, HttpMediaTypeNotSupportedException, HttpMessageNotReadableException Create the method argument value of the expected parameter type by reading from the given request.
| |
| supportsParameter | back to summary |
|---|---|
| public boolean supportsParameter(MethodParameter parameter) Implements org. Doc from org. Whether the given method parameter is supported by this resolver.
| |
| supportsReturnType | back to summary |
|---|---|
| public boolean supportsReturnType(MethodParameter returnType) Implements org. Doc from org. Whether the given method return type is supported by this handler.
| |