Top For Removal Deprecated
Spring Web 6.1.4

Deprecated API


Terminally Deprecated Item Summary

SinceTerminally Deprecated Item and Description
6.0.3
6.0.3
6.0
6.0
org.springframework.http.MediaType.SPECIFICITY_COMPARATOR

As of 6.0, with no direct replacement

6.0
org.springframework.http.MediaType.sortByQualityValue(List<MediaType>
the list of media types to be sorted
mediaTypes
)

As of 6.0, with no direct replacement

6.0
org.springframework.http.MediaType.sortBySpecificity(List<MediaType>
the list of media types to be sorted
mediaTypes
)

As of 6.0, in favor of MimeTypeUtils#sortBySpecificity(List)

6.0
org.springframework.http.client.AbstractClientHttpResponse

as of 6.0, with no direct replacement; scheduled for removal in 6.2

6.0

Returns:

the HTTP status as an integer value
org.springframework.http.client.ClientHttpResponse.getRawStatusCode
()

as of 6.0, in favor of getStatusCode(); scheduled for removal in 6.2

6.1
org.springframework.http.client.HttpComponentsClientHttpRequestFactory.setBufferRequestBody(boolean bufferRequestBody)

since 6.1 requests are never buffered, as if this property is false

6.1
6.1
org.springframework.http.client.OkHttp3ClientHttpRequestFactory

since 6.1, in favor of other ClientHttpRequestFactory implementations; scheduled for removal in 6.2

6.1
6.1
org.springframework.http.client.SimpleClientHttpRequestFactory.setBufferRequestBody(boolean bufferRequestBody)

since 6.1 requests are never buffered, as if this property is false

6.1
org.springframework.http.client.SimpleClientHttpRequestFactory.setOutputStreaming(boolean
if output streaming is enabled
outputStreaming
)

as of 6.1 requests are always streamed, as if this property is true

6.0.5
org.springframework.http.client.observation.ClientHttpObservationDocumentation.HighCardinalityKeyNames.CLIENT_NAME

in favor of LowCardinalityKeyNames#CLIENT_NAME; scheduled for removal in 6.2. This will be available both as a low and high cardinality key value.

6.1
6.1
6.1
6.1

Returns:

a Map with errors as keys and resolved messages as values
org.springframework.web.bind.MethodArgumentNotValidException.resolveErrorMessages
(MessageSource messageSource, Locale locale)

in favor of using BindErrorUtils and getAllErrors(), to be removed in 6.2

6.1
org.springframework.web.bind.MissingServletRequestParameterException.MissingServletRequestParameterException(String
the name of the missing parameter
parameterName
,
String
the expected type of the missing parameter
parameterType
,
boolean
whether the value became null after conversion
missingAfterConversion
)

in favor of MissingServletRequestParameterException(String, MethodParameter, boolean)

6.1

Returns:

a Map with errors as key and resolves messages as value
org.springframework.web.bind.support.WebExchangeBindException.resolveErrorMessages
(MessageSource messageSource, Locale locale)

in favor of using BindErrorUtils and getAllErrors(), to be removed in 6.2

6.1
6.0.6

Returns:

an Optional with the exchange if found
org.springframework.web.filter.reactive.ServerWebExchangeContextFilter.get
(Context
the context to get the exchange from
context
)

in favor of using getExchange(ContextView) which accepts a ContextView instead of Context, reflecting the fact that the ContextView is needed only for reading.

6.1
6.1
6.1
6.1
6.1
6.1
6.1
6.1

Returns:

this same builder instance
org.springframework.web.service.invoker.HttpServiceProxyFactory.Builder.blockTimeout
(Duration
the timeout value
blockTimeout
)

in favor of setting the same directly on the HttpExchangeAdapter

6.1

Returns:

this same builder instance
org.springframework.web.service.invoker.HttpServiceProxyFactory.Builder.clientAdapter
(HttpClientAdapter
a client adapted to HttpClientAdapter
clientAdapter
)

in favor of exchangeAdapter(HttpExchangeAdapter); to be removed in 6.2

6.1

Returns:

this same builder instance
org.springframework.web.service.invoker.HttpServiceProxyFactory.Builder.reactiveAdapterRegistry
(ReactiveAdapterRegistry registry)

in favor of setting the same directly on the HttpExchangeAdapter

6.1
6.1

Returns:

the URI components of the URI
org.springframework.web.util.UriComponentsBuilder.fromHttpRequest
(HttpRequest
the source request
request
)

in favor of ForwardedHeaderUtils#adaptFromForwardedHeaders; to be removed in 6.2

6.1

Returns:

an InetSocketAddress with the extracted host and port, or null if the headers are not present.
org.springframework.web.util.UriComponentsBuilder.parseForwardedFor
(HttpRequest
a request with headers that may contain forwarded headers
request
,
InetSocketAddress
the current remoteAddress
remoteAddress
)

in favor of ForwardedHeaderUtils#parseForwardedFor; to be removed in 6.2

Deprecated Item Summary

SinceDeprecated Item and Description
org.springframework.http.ContentDisposition.Builder.creationDate(ZonedDateTime creationDate)

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

org.springframework.http.ContentDisposition.Builder.modificationDate(ZonedDateTime modificationDate)

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

org.springframework.http.ContentDisposition.Builder.readDate(ZonedDateTime readDate)

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

org.springframework.http.ContentDisposition.Builder.size(Long size)

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

org.springframework.http.ContentDisposition.getCreationDate()

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

org.springframework.http.ContentDisposition.getModificationDate()

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

org.springframework.http.ContentDisposition.getReadDate()

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

org.springframework.http.ContentDisposition.getSize()

since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.

6.0.5
org.springframework.http.HttpStatus.CHECKPOINT

in favor of EARLY_HINTS which will be returned from HttpStatus.valueOf(103)

org.springframework.http.HttpStatus.MOVED_TEMPORARILY

in favor of FOUND which will be returned from HttpStatus.valueOf(302)

org.springframework.http.HttpStatus.REQUEST_ENTITY_TOO_LARGE

in favor of PAYLOAD_TOO_LARGE which will be returned from HttpStatus.valueOf(413)

org.springframework.http.HttpStatus.REQUEST_URI_TOO_LONG

in favor of URI_TOO_LONG which will be returned from HttpStatus.valueOf(414)

Returns:

the Series enum constant for the supplied HttpStatus
org.springframework.http.HttpStatus.Series.valueOf
(HttpStatus
a standard HTTP status enum constant
status
)

as of 5.3, in favor of invoking HttpStatus#series() directly

org.springframework.http.HttpStatus.USE_PROXY

due to security concerns regarding in-band configuration of a proxy

org.springframework.http.MediaType.APPLICATION_JSON_UTF8

as of 5.2 in favor of APPLICATION_JSON since major browsers like Chrome now comply with the specification and interpret correctly UTF-8 special characters without requiring a charset=UTF-8 parameter.

org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE

as of 5.2 in favor of APPLICATION_JSON_VALUE since major browsers like Chrome now comply with the specification and interpret correctly UTF-8 special characters without requiring a charset=UTF-8 parameter.

org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_UTF8

as of 5.2 in favor of APPLICATION_PROBLEM_JSON since major browsers like Chrome now comply with the specification and interpret correctly UTF-8 special characters without requiring a charset=UTF-8 parameter.

org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_UTF8_VALUE

as of 5.2 in favor of APPLICATION_PROBLEM_JSON_VALUE since major browsers like Chrome now comply with the specification and interpret correctly UTF-8 special characters without requiring a charset=UTF-8 parameter.

org.springframework.http.MediaType.APPLICATION_STREAM_JSON_VALUE

as of 5.3 since it originates from the W3C Activity Streams specification which has a more specific purpose and has been since replaced with a different mime type. Use APPLICATION_NDJSON as a replacement or any other line-delimited JSON format (e.g. JSON Lines, JSON Text Sequences).

6.0
6.0

Returns:

the HTTP status as an int value
org.springframework.http.ResponseEntity.getStatusCodeValue
()

as of 6.0, in favor of getStatusCode(); scheduled for removal in 7.0

org.springframework.http.client.reactive.JettyClientHttpConnector.JettyDataBuffer.asByteBuffer(int
the index at which to start the byte buffer
index
,
int
the length of the returned byte buffer
length
)

org.springframework.http.client.reactive.JettyClientHttpConnector.JettyDataBuffer.slice(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

6.1
org.springframework.http.server.reactive.AbstractListenerWriteProcessor.writingPaused()

originally introduced for Undertow to stop write notifications when no data is available, but deprecated as of 5.0.6 since constant switching on every requested item causes a significant slowdown.

6.0
org.springframework.web.HttpMediaTypeException.HttpMediaTypeException(String message, List<MediaType>
the list of supported media types
supportedMediaTypes
)

as of 6.0

org.springframework.web.accept.ContentNegotiationManagerFactoryBean.setFavorPathExtension(boolean favorPathExtension)

as of 5.2.4. See class-level note on the deprecation of path extension config options. As there is no replacement for this method, in 5.2.x it is necessary to set it to false. In 5.3 the default changes to false and use of this property becomes unnecessary.

org.springframework.web.accept.ContentNegotiationManagerFactoryBean.setIgnoreUnknownPathExtensions(boolean ignore)

as of 5.2.4. See class-level note on the deprecation of path extension config options.

org.springframework.web.accept.PathExtensionContentNegotiationStrategy

as of 5.2.4. See class-level note in ContentNegotiationManagerFactoryBean on the deprecation of path extension config options.

org.springframework.web.accept.ServletPathExtensionContentNegotiationStrategy

as of 5.2.4. See class-level note in ContentNegotiationManagerFactoryBean on the deprecation of path extension config options.

Returns:

true if the response indicates an error; false otherwise
org.springframework.web.client.DefaultResponseErrorHandler.hasError
(int
the HTTP status code as raw value
statusCode
)

in favor of hasError(HttpStatusCode)

6.0

Returns:

an arbitrary object, as returned by the ResponseExtractor
org.springframework.web.client.RestTemplate.doExecute
(URI
the fully-expanded URL to connect to
url
,
HttpMethod
the HTTP method to execute (GET, POST, etc.)
method
,
RequestCallback
object that prepares the request (can be null)
requestCallback
,
ResponseExtractor<T>
object that extracts the return value from the response (can be null)
responseExtractor
)

in favor of doExecute(URI, String, HttpMethod, RequestCallback, ResponseExtractor)

6.0
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.themeSource

Deprecated as a consequence of ThemeSource being deprecated. See corresponding docs for further information.

org.springframework.web.context.support.GenericWebApplicationContext.themeSource

Deprecated as a consequence of ThemeSource being deprecated. See corresponding docs for further information.

org.springframework.web.context.support.StaticWebApplicationContext.themeSource

Deprecated as a consequence of ThemeSource being deprecated. See corresponding docs for further information.

org.springframework.web.cors.UrlBasedCorsConfigurationSource.setAlwaysUseFullPath(boolean alwaysUseFullPath)

as of 5.3 in favor of using setUrlPathHelper(UrlPathHelper), if at all. For further details, please see setAllowInitLookupPath(boolean).

org.springframework.web.cors.UrlBasedCorsConfigurationSource.setRemoveSemicolonContent(boolean removeSemicolonContent)

as of 5.3 in favor of using setUrlPathHelper(UrlPathHelper), if at all. For further details, please see setAllowInitLookupPath(boolean).

org.springframework.web.cors.UrlBasedCorsConfigurationSource.setUrlDecode(boolean urlDecode)

as of 5.3 in favor of using setUrlPathHelper(UrlPathHelper), if at all. For further details, please see setAllowInitLookupPath(boolean).

Returns:

true if the request is a same-origin one, false in case of a cross-origin request
org.springframework.web.cors.reactive.CorsUtils.isSameOrigin
(ServerHttpRequest request)

as of 5.2, same-origin checks are performed directly by isCorsRequest

6.0
org.springframework.web.method.support.ModelAndViewContainer.setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect)

as of 6.0 without a replacement; once removed, the default model will always be ignored on redirect

6.0
6.0
6.0
6.0
6.0

Returns:

the associated HTTP status code, or -1 if it can't be derived.
org.springframework.web.server.handler.ResponseStatusExceptionHandler.determineRawStatusCode
(Throwable
the exception to check
ex
)

as of 6.0, in favor of determineStatus(Throwable)

6.0

Returns:

the lookup path
org.springframework.web.util.UrlPathHelper.getLookupPathForRequest
(HttpServletRequest
current HTTP request
request
,
String
the request attribute that holds the lookupPath
name
)

as of 5.3 in favor of using resolveAndCacheLookupPath(HttpServletRequest) and getResolvedLookupPath(ServletRequest).

6.0
6.0
org.springframework.web.util.pattern.PathPatternParser.setMatchOptionalTrailingSeparator(boolean matchOptionalTrailingSeparator)

transparent support for trailing slashes is deprecated as of 6.0 in favor of configuring explicit redirects through a proxy, Servlet/web filter, or a controller.