Upgrading org.springframework:spring-context-support 6 to 7
Breaking6.2.19 → 7.0.10Breaking24Security18Deprecated17New196Changed263Fixed303Other155
BreakingUpgrade verdict
24 breaking changes and 18 security fixes.
In plain terms
- Two web filters that read proxy forwarding headers now let you explicitly choose which header style to trust. The old constructor still works as before, but the new one is recommended.
- A safer expression evaluation context now skips compiling expressions unless you explicitly ask for it. Compiling can be faster but removes safety checks.
- Simplifies TransactionalOperator.executeAndAwait by removing Optional from its signature.
- Renames maxAttempts to maxRetries in @Retryable and RetryPolicy.
Must act Top 5 of 59 that need code or config changes
org.springframework:spring-context-support publishes an official migration guide for version 7. It covers more than the release notes do.
The official release notes and upgrade guide ↗Installs 9 packages in all (was 8).
What you must change
Breaking24
ForwardedHeaderFilter and ForwardedHeaderTransformer add a boolean constructor argument to choose standard Forwarded or X-Forwarded headers; default constructor keeps existing behavior.
ForwardedHeaderFilterForwardedHeaderTransformerSimpleEvaluationContext no longer supports expression compilation by default; opt in via withCompilationSupported() on the builder.
SimpleEvaluationContextSpelParserConfigurationspring.expression.compiler.modewithCompilationSupported()Simplifies TransactionalOperator.executeAndAwait by removing Optional from its signature.
TransactionalOperatorexecuteAndAwaitRenames maxAttempts to maxRetries in @Retryable and RetryPolicy.
@RetryableRetryPolicymaxAttemptsmaxRetriesRemoves the Hamcrest dependency from RestTestClient.
RestTestClientRemoves support for callable references in
BeanRegistrarDsl.BeanRegistrarDslRemoves HttpServiceClient annotation support.
HttpServiceClientRemoves maxDuration and maxElapsedTime support from RetryPolicy.
RetryPolicymaxDurationmaxElapsedTimeRemoves (String, String) variants of setProperty() and withProperty() from MockEnvironment.
MockEnvironmentsetProperty()withProperty()Removes support for Aware interfaces in BeanRegistrar.
AwareBeanRegistrarRemoves the deprecated rowsExpected property of SqlQuery.
SqlQueryrowsExpectedRemoves convention-based annotation attribute override support.
Removes Netty 5 support.
Removes binary array name handling in ClassUtils.forName().
ClassUtils.forName()Remove path mapping options marked as deprecated for removal.
ApiVersionConfigurer.setSupportedVersionPredicate() now returns void instead of ApiVersionConfigurer.
ApiVersionConfigurersetSupportedVersionPredicate()Revises ApplicationContext#getId() nullability to non-null.
ApplicationContext#getId()Changes canRead/canWrite overrides to Class ones in AbstractSmartHttpMessageConverter.
AbstractSmartHttpMessageConvertercanReadcanWriteMakes RetryException#getCause non-nullable.
RetryExceptiongetCauseRefines Jackson 3 constructors to accept only JsonMapper instances for JSON.
JsonMapperReplaces useRequestParam with useQueryParam in ApiVersionConfigurer to align with the client.
ApiVersionConfigureruseRequestParamuseQueryParamMigrates orm.hibernate5 to the orm.jpa.hibernate package for Hibernate ORM 7.0.
orm.hibernate5orm.jpa.hibernateRedesigns RetryPolicy to directly incorporate BackOff.
RetryPolicyBackOffMakes built-in RetryPolicy implementations final.
RetryPolicySecurity18
Limits result size of BigDecimal/BigInteger power operations in SpEL.
BigDecimalBigIntegerFixes CVE-2026-41838, a predictable session ID issue in the WebSocket module.
Fixes CVE-2026-41839, a privilege escalation via session fixation in WebFlux.
Fixes CVE-2026-41840, a denial of service via multipart requests in WebFlux.
Fixes CVE-2026-41841, an information disclosure via static resource cache in Spring MVC and WebFlux.
Fixes CVE-2026-41842, a denial of service via versioned resources in Spring MVC and WebFlux.
Fixes CVE-2026-41843, a path traversal via versioned static resources in Spring MVC and WebFlux.
Fixes CVE-2026-41844, an open redirect in Spring MVC and WebFlux.
Fixes CVE-2026-41845, a cross-site scripting issue via JavaScriptUtils.
JavaScriptUtilsFixes CVE-2026-41846, a cross-site scripting issue via JSP form tags.
Fixes CVE-2026-41848, a denial of service via AntPathMatcher.
AntPathMatcherFixes CVE-2026-41850, an algorithmic denial of service via SpEL expressions.
Fixes CVE-2026-41851, a denial of service via an unbounded cache in SpEL.
Fixes CVE-2026-41852, arbitrary method invocation in SpEL expressions.
Fixes CVE-2026-41853, multipart request smuggling in Spring MVC and WebFlux.
Fixes CVE-2026-41854, a server-side request forgery via UriComponentsBuilder.
UriComponentsBuilderFixes CVE-2026-41855, unsafe deserialization via Jackson JMS converters.
Warns against unsafe static resource locations in MVC and WebFlux.
Deprecations to plan for
Deprecated17
Deprecates methodIdentification() in CacheAspectSupport for removal.
CacheAspectSupportmethodIdentification()Deprecate PagedListHolder and PropertyComparator for removal.
PagedListHolderPropertyComparatorDeprecates MockMvcClientHttpRequestFactory, which is still required for tests with HTTP service interface proxy.
MockMvcClientHttpRequestFactoryDeprecates the BeanShell scripting support.
Deprecates the
lang XML namespace.langDeprecates Hamcrest methods in WebTestClient.
WebTestClientDeprecates TransactionCallbackWithoutResult.
TransactionCallbackWithoutResultDeprecates the org.springframework.web.servlet.view.document package.
org.springframework.web.servlet.view.documentDeprecates put(MergedContextConfiguration, ApplicationContext) in ContextCache.
ContextCacheput(MergedContextConfiguration, ApplicationContext)MergedContextConfigurationApplicationContextDeprecates the DaoSupport classes.
DaoSupportDeprecates PropertyPlaceholderConfigurer and PreferencesPlaceholderConfigurer for removal.
PropertyPlaceholderConfigurerPreferencesPlaceholderConfigurerDeprecates JUnit 4 support in the Spring TestContext Framework.
TestContextDeprecate PathExtensionPredicate in functional web frameworks.
PathExtensionPredicateDeprecate mvc XML configuration namespace.
Deprecate HandlerMappingIntrospector.
HandlerMappingIntrospectorDeprecate use of PathMatcher in web modules.
PathMatcherDeprecate use of several bean factory methods for the same bean in a configuration class.
API changes
Generated by DepDelta from published JVM bytecode. Not mixed with prose notes.
- added:
method JCacheCacheManager.resetCaches(): void
- added:
method ConfigurableMimeFileTypeMap.getContentType(Path): String
- removed:
method SimpleThreadPoolTaskExecutor.submitListenable(Callable): ListenableFuture - removed:
method SimpleThreadPoolTaskExecutor.submitListenable(Runnable): ListenableFuture - changed:
class SimpleThreadPoolTaskExecutor extends SimpleThreadPool implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, InitializingBean, DisposableBean → class SimpleThreadPoolTaskExecutor extends SimpleThreadPool implements AsyncTaskExecutor, SchedulingTaskExecutor, InitializingBean, DisposableBean