@Deprecated public abstract class AbstractJsonpResponseBodyAdvice extends AbstractMappingJacksonResponseBodyAdvice
ResponseBodyAdvice
to instruct the
MappingJackson2HttpMessageConverter
to serialize with JSONP formatting.
Sub-classes must specify the query parameter name(s) to check for the name of the JSONP callback function.
Sub-classes are likely to be annotated with the @ControllerAdvice
annotation and auto-detected or otherwise must be registered directly with the
RequestMappingHandlerAdapter
and ExceptionHandlerExceptionResolver
.
Modifier | Constructor and Description |
---|---|
protected |
AbstractJsonpResponseBodyAdvice(String... queryParamNames)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
beforeBodyWriteInternal(MappingJacksonValue bodyContainer,
MediaType contentType,
MethodParameter returnType,
ServerHttpRequest request,
ServerHttpResponse response)
Deprecated.
Invoked only if the converter type is
MappingJackson2HttpMessageConverter . |
protected MediaType |
getContentType(MediaType contentType,
ServerHttpRequest request,
ServerHttpResponse response)
Deprecated.
Return the content type to set the response to.
|
protected boolean |
isValidJsonpQueryParam(String value)
Deprecated.
Validate the jsonp query parameter value.
|
beforeBodyWrite, getOrCreateContainer, supports
protected AbstractJsonpResponseBodyAdvice(String... queryParamNames)
protected void beforeBodyWriteInternal(MappingJacksonValue bodyContainer, MediaType contentType, MethodParameter returnType, ServerHttpRequest request, ServerHttpResponse response)
AbstractMappingJacksonResponseBodyAdvice
MappingJackson2HttpMessageConverter
.beforeBodyWriteInternal
in class AbstractMappingJacksonResponseBodyAdvice
protected boolean isValidJsonpQueryParam(String value)
value
- the query param value, never null
protected MediaType getContentType(MediaType contentType, ServerHttpRequest request, ServerHttpResponse response)
contentType
- the content type selected through content negotiationrequest
- the current requestresponse
- the current response