Skip navigation links
spring-web
  • Overview
  • Package
  • Class
  • Use
  • Tree
  • Deprecated
  • Index
  • Help

Deprecated API

Contents

  • Terminally Deprecated
  • Classes
  • Exceptions
  • Fields
  • Methods
  • Constructors
  • Enum Constants
  • Terminally Deprecated Elements
    Element
    Description
    org.springframework.http.client.HttpComponentsClientHttpRequestFactory.setReadTimeout(int)
    as of 6.0, in favor of SocketConfig.Builder.setSoTimeout(Timeout), see above.
    org.springframework.http.client.observation.ClientHttpObservationDocumentation.HighCardinalityKeyNames.CLIENT_NAME
    in favor of ClientHttpObservationDocumentation.LowCardinalityKeyNames.CLIENT_NAME; scheduled for removal in 6.2. This will be available both as a low and high cardinality key value.
    org.springframework.http.client.reactive.ClientHttpResponse.getRawStatusCode()
    as of 6.0, in favor of ClientHttpResponse.getStatusCode()
    org.springframework.http.codec.multipart.DefaultPartHttpMessageReader.setStreaming(boolean)
    as of 6.0, in favor of PartEvent and PartEventHttpMessageReader
    org.springframework.http.HttpMethod.resolve(String)
    in favor of HttpMethod.valueOf(String)
    org.springframework.http.HttpRequest.getMethodValue()
    as of Spring Framework 6.0 in favor of HttpRequest.getMethod() and HttpMethod.name()
    org.springframework.http.MediaType.APPLICATION_GRAPHQL
    as of 6.0.3, in favor of APPLICATION_GRAPHQL_RESPONSE
    org.springframework.http.MediaType.APPLICATION_GRAPHQL_VALUE
    as of 6.0.3, in favor of APPLICATION_GRAPHQL_RESPONSE_VALUE
    org.springframework.http.MediaType.QUALITY_VALUE_COMPARATOR
    As of 6.0, with no direct replacement
    org.springframework.http.MediaType.sortByQualityValue(List<MediaType>)
    As of 6.0, with no direct replacement
    org.springframework.http.MediaType.sortBySpecificity(List<MediaType>)
    As of 6.0, in favor of MimeTypeUtils.sortBySpecificity(List)
    org.springframework.http.MediaType.SPECIFICITY_COMPARATOR
    As of 6.0, with no direct replacement
    org.springframework.http.server.reactive.AbstractServerHttpRequest(URI, String, HttpHeaders)
    since 6.0.8, in favor of AbstractServerHttpRequest(HttpMethod, URI, String, MultiValueMap)
    org.springframework.http.server.reactive.AbstractServerHttpRequest(URI, String, MultiValueMap<String, String>)
    since 6.0.8, in favor of AbstractServerHttpRequest(HttpMethod, URI, String, MultiValueMap)
    org.springframework.web.bind.MethodArgumentNotValidException(Executable, BindingResult)
    in favor of MethodArgumentNotValidException(MethodParameter, BindingResult)
    org.springframework.web.filter.reactive.ServerWebExchangeContextFilter.get(Context)
    in favor of using ServerWebExchangeContextFilter.getExchange(ContextView) which accepts a ContextView instead of Context, reflecting the fact that the ContextView is needed only for reading.
    org.springframework.web.HttpRequestMethodNotSupportedException(String, String)
    in favor of HttpRequestMethodNotSupportedException(String, Collection)
    org.springframework.web.HttpRequestMethodNotSupportedException(String, String[])
    in favor of HttpRequestMethodNotSupportedException(String, Collection)
    org.springframework.web.HttpRequestMethodNotSupportedException(String, String[], String)
    in favor of HttpRequestMethodNotSupportedException(String, Collection)
  • Deprecated Classes
    Class
    Description
    org.springframework.http.client.AbstractClientHttpResponse
    as of 6.0, with no direct replacement; scheduled for removal in 6.2
    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.
    org.springframework.web.util.CookieGenerator
    as of 6.0 in favor of ResponseCookie
  • Deprecated Exceptions
    Exceptions
    Description
    org.springframework.web.util.NestedServletException
    as of 6.0, in favor of standard ServletException nesting
  • Deprecated Fields
    Field
    Description
    org.springframework.http.MediaType.APPLICATION_GRAPHQL
    as of 6.0.3, in favor of APPLICATION_GRAPHQL_RESPONSE
    org.springframework.http.MediaType.APPLICATION_GRAPHQL_VALUE
    as of 6.0.3, in favor of APPLICATION_GRAPHQL_RESPONSE_VALUE
    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
    as of 5.3, see notice on APPLICATION_STREAM_JSON_VALUE.
    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).
    org.springframework.http.MediaType.QUALITY_VALUE_COMPARATOR
    As of 6.0, with no direct replacement
    org.springframework.http.MediaType.SPECIFICITY_COMPARATOR
    As of 6.0, with no direct replacement
  • Deprecated Methods
    Method
    Description
    org.springframework.http.client.ClientHttpResponse.getRawStatusCode()
    as of 6.0, in favor of ClientHttpResponse.getStatusCode(); scheduled for removal in 6.2
    org.springframework.http.client.HttpComponentsClientHttpRequestFactory.setReadTimeout(int)
    as of 6.0, in favor of SocketConfig.Builder.setSoTimeout(Timeout), see above.
    org.springframework.http.client.reactive.ClientHttpResponse.getRawStatusCode()
    as of 6.0, in favor of ClientHttpResponse.getStatusCode()
    org.springframework.http.codec.CodecConfigurer.CustomCodecs.decoder(Decoder<?>)
    as of 5.1.13, use CodecConfigurer.CustomCodecs.register(Object) or CodecConfigurer.CustomCodecs.registerWithDefaultConfig(Object) instead.
    org.springframework.http.codec.CodecConfigurer.CustomCodecs.encoder(Encoder<?>)
    as of 5.1.13, use CodecConfigurer.CustomCodecs.register(Object) or CodecConfigurer.CustomCodecs.registerWithDefaultConfig(Object) instead.
    org.springframework.http.codec.CodecConfigurer.CustomCodecs.reader(HttpMessageReader<?>)
    as of 5.1.13, use CodecConfigurer.CustomCodecs.register(Object) or CodecConfigurer.CustomCodecs.registerWithDefaultConfig(Object) instead.
    org.springframework.http.codec.CodecConfigurer.CustomCodecs.withDefaultCodecConfig(Consumer<CodecConfigurer.DefaultCodecConfig>)
    as of 5.1.13, use CodecConfigurer.CustomCodecs.registerWithDefaultConfig(Object) or CodecConfigurer.CustomCodecs.registerWithDefaultConfig(Object, Consumer) instead.
    org.springframework.http.codec.CodecConfigurer.CustomCodecs.writer(HttpMessageWriter<?>)
    as of 5.1.13, use CodecConfigurer.CustomCodecs.register(Object) or CodecConfigurer.CustomCodecs.registerWithDefaultConfig(Object) instead.
    org.springframework.http.codec.multipart.DefaultPartHttpMessageReader.setStreaming(boolean)
    as of 6.0, in favor of PartEvent and PartEventHttpMessageReader
    org.springframework.http.ContentDisposition.Builder.creationDate(ZonedDateTime)
    since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.
    org.springframework.http.ContentDisposition.Builder.modificationDate(ZonedDateTime)
    since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.
    org.springframework.http.ContentDisposition.Builder.readDate(ZonedDateTime)
    since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.
    org.springframework.http.ContentDisposition.Builder.size(Long)
    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.
    org.springframework.http.HttpMethod.resolve(String)
    in favor of HttpMethod.valueOf(String)
    org.springframework.http.HttpRequest.getMethodValue()
    as of Spring Framework 6.0 in favor of HttpRequest.getMethod() and HttpMethod.name()
    org.springframework.http.HttpStatus.Series.valueOf(HttpStatus)
    as of 5.3, in favor of invoking HttpStatus.series() directly
    org.springframework.http.MediaType.sortByQualityValue(List<MediaType>)
    As of 6.0, with no direct replacement
    org.springframework.http.MediaType.sortBySpecificity(List<MediaType>)
    As of 6.0, in favor of MimeTypeUtils.sortBySpecificity(List)
    org.springframework.http.MediaType.sortBySpecificityAndQuality(List<MediaType>)
    As of 6.0, in favor of MimeTypeUtils.sortBySpecificity(List)
    org.springframework.http.ResponseEntity.getStatusCodeValue()
    as of 6.0, in favor of ResponseEntity.getStatusCode(); scheduled for removal in 7.0
    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.
    org.springframework.http.server.reactive.AbstractServerHttpResponse.getRawStatusCode()
    org.springframework.http.server.reactive.ServerHttpResponse.getRawStatusCode()
    as of 6.0, in favor of ServerHttpResponse.getStatusCode()
    org.springframework.http.server.reactive.ServerHttpResponseDecorator.getRawStatusCode()
    org.springframework.web.accept.ContentNegotiationManagerFactoryBean.setFavorPathExtension(boolean)
    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)
    as of 5.2.4. See class-level note on the deprecation of path extension config options.
    org.springframework.web.accept.ContentNegotiationManagerFactoryBean.setUseJaf(boolean)
    as of 5.0, in favor of ContentNegotiationManagerFactoryBean.setUseRegisteredExtensionsOnly(boolean), which has reverse behavior.
    org.springframework.web.accept.PathExtensionContentNegotiationStrategy.setUseJaf(boolean)
    as of 5.0, in favor of AbstractMappingContentNegotiationStrategy.setUseRegisteredExtensionsOnly(boolean).
    org.springframework.web.client.DefaultResponseErrorHandler.hasError(int)
    in favor of DefaultResponseErrorHandler.hasError(HttpStatusCode)
    org.springframework.web.client.RestClientResponseException.getRawStatusCode()
    as of 6.0, in favor of RestClientResponseException.getStatusCode()
    org.springframework.web.client.RestTemplate.doExecute(URI, HttpMethod, RequestCallback, ResponseExtractor<T>)
    in favor of RestTemplate.doExecute(URI, String, HttpMethod, RequestCallback, ResponseExtractor)
    org.springframework.web.client.UnknownContentTypeException.getRawStatusCode()
    as of 6.0, in favor of UnknownContentTypeException.getStatusCode()
    org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.getTheme(String)
    org.springframework.web.context.support.GenericWebApplicationContext.getTheme(String)
    org.springframework.web.context.support.StaticWebApplicationContext.getTheme(String)
    org.springframework.web.cors.reactive.CorsUtils.isSameOrigin(ServerHttpRequest)
    as of 5.2, same-origin checks are performed directly by CorsUtils.isCorsRequest(org.springframework.http.server.reactive.ServerHttpRequest)
    org.springframework.web.cors.UrlBasedCorsConfigurationSource.setAlwaysUseFullPath(boolean)
    as of 5.3 in favor of using UrlBasedCorsConfigurationSource.setUrlPathHelper(UrlPathHelper), if at all. For further details, please see UrlBasedCorsConfigurationSource.setAllowInitLookupPath(boolean).
    org.springframework.web.cors.UrlBasedCorsConfigurationSource.setLookupPathAttributeName(String)
    as of 5.3 in favor of UrlPathHelper.PATH_ATTRIBUTE.
    org.springframework.web.cors.UrlBasedCorsConfigurationSource.setRemoveSemicolonContent(boolean)
    as of 5.3 in favor of using UrlBasedCorsConfigurationSource.setUrlPathHelper(UrlPathHelper), if at all. For further details, please see UrlBasedCorsConfigurationSource.setAllowInitLookupPath(boolean).
    org.springframework.web.cors.UrlBasedCorsConfigurationSource.setUrlDecode(boolean)
    as of 5.3 in favor of using UrlBasedCorsConfigurationSource.setUrlPathHelper(UrlPathHelper), if at all. For further details, please see UrlBasedCorsConfigurationSource.setAllowInitLookupPath(boolean).
    org.springframework.web.filter.reactive.ServerWebExchangeContextFilter.get(Context)
    in favor of using ServerWebExchangeContextFilter.getExchange(ContextView) which accepts a ContextView instead of Context, reflecting the fact that the ContextView is needed only for reading.
    org.springframework.web.method.support.ModelAndViewContainer.setIgnoreDefaultModelOnRedirect(boolean)
    as of 6.0 without a replacement; once removed, the default model will always be ignored on redirect
    org.springframework.web.server.handler.ResponseStatusExceptionHandler.determineRawStatusCode(Throwable)
    as of 6.0, in favor of ResponseStatusExceptionHandler.determineStatus(Throwable)
    org.springframework.web.server.MethodNotAllowedException.getResponseHeaders()
    as of 6.0 in favor of MethodNotAllowedException.getHeaders()
    org.springframework.web.server.NotAcceptableStatusException.getResponseHeaders()
    as of 6.0 in favor of NotAcceptableStatusException.getHeaders()
    org.springframework.web.server.ResponseStatusException.getResponseHeaders()
    as of 6.0 in favor of ResponseStatusException.getHeaders()
    org.springframework.web.server.UnsupportedMediaTypeStatusException.getResponseHeaders()
    as of 6.0 in favor of UnsupportedMediaTypeStatusException.getHeaders()
    org.springframework.web.util.pattern.PathPatternParser.isMatchOptionalTrailingSeparator()
    as of 6.0 together with PathPatternParser.setMatchOptionalTrailingSeparator(boolean).
    org.springframework.web.util.pattern.PathPatternParser.setMatchOptionalTrailingSeparator(boolean)
    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.
    org.springframework.web.util.UrlPathHelper.getLookupPathForRequest(HttpServletRequest, String)
    as of 5.3 in favor of using UrlPathHelper.resolveAndCacheLookupPath(HttpServletRequest) and UrlPathHelper.getResolvedLookupPath(ServletRequest).
  • Deprecated Constructors
    Constructor
    Description
    org.springframework.http.client.reactive.JettyClientHttpConnector(JettyResourceFactory, Consumer<HttpClient>)
    as of 5.2, in favor of JettyClientHttpConnector(HttpClient, JettyResourceFactory)
    org.springframework.http.converter.HttpMessageNotReadableException(String)
    as of 5.1, in favor of HttpMessageNotReadableException(String, HttpInputMessage)
    org.springframework.http.converter.HttpMessageNotReadableException(String, Throwable)
    as of 5.1, in favor of HttpMessageNotReadableException(String, Throwable, HttpInputMessage)
    org.springframework.http.server.reactive.AbstractServerHttpRequest(URI, String, HttpHeaders)
    since 6.0.8, in favor of AbstractServerHttpRequest(HttpMethod, URI, String, MultiValueMap)
    org.springframework.http.server.reactive.AbstractServerHttpRequest(URI, String, MultiValueMap<String, String>)
    since 6.0.8, in favor of AbstractServerHttpRequest(HttpMethod, URI, String, MultiValueMap)
    org.springframework.web.bind.MethodArgumentNotValidException(Executable, BindingResult)
    in favor of MethodArgumentNotValidException(MethodParameter, BindingResult)
    org.springframework.web.HttpMediaTypeException(String)
    as of 6.0
    org.springframework.web.HttpMediaTypeException(String, List<MediaType>)
    as of 6.0
    org.springframework.web.HttpRequestMethodNotSupportedException(String, String)
    in favor of HttpRequestMethodNotSupportedException(String, Collection)
    org.springframework.web.HttpRequestMethodNotSupportedException(String, String[])
    in favor of HttpRequestMethodNotSupportedException(String, Collection)
    org.springframework.web.HttpRequestMethodNotSupportedException(String, String[], String)
    in favor of HttpRequestMethodNotSupportedException(String, Collection)
  • Deprecated Enum Constants
    Enum Constant
    Description
    org.springframework.http.client.observation.ClientHttpObservationDocumentation.HighCardinalityKeyNames.CLIENT_NAME
    in favor of ClientHttpObservationDocumentation.LowCardinalityKeyNames.CLIENT_NAME; scheduled for removal in 6.2. This will be available both as a low and high cardinality key value.
    org.springframework.http.HttpStatus.CHECKPOINT
    in favor of HttpStatus.EARLY_HINTS which will be returned from HttpStatus.valueOf(103)
    org.springframework.http.HttpStatus.DESTINATION_LOCKED
    See WebDAV Draft Changes
    org.springframework.http.HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE
    See WebDAV Draft Changes
    org.springframework.http.HttpStatus.METHOD_FAILURE
    See WebDAV Draft Changes
    org.springframework.http.HttpStatus.MOVED_TEMPORARILY
    in favor of HttpStatus.FOUND which will be returned from HttpStatus.valueOf(302)
    org.springframework.http.HttpStatus.REQUEST_ENTITY_TOO_LARGE
    in favor of HttpStatus.PAYLOAD_TOO_LARGE which will be returned from HttpStatus.valueOf(413)
    org.springframework.http.HttpStatus.REQUEST_URI_TOO_LONG
    in favor of HttpStatus.URI_TOO_LONG which will be returned from HttpStatus.valueOf(414)
    org.springframework.http.HttpStatus.USE_PROXY
    due to security concerns regarding in-band configuration of a proxy