⚠️ Attention Required
- starting in Spring Framework 7.1,
ForwardedHeaderFilter(Spring MVC) andForwardedHeaderTransformer(WebFlux) each require a boolean argument whether to use the standard "Forwarded" header or the "X-Forwarded" alternative headers. A separate property enables use of "X-Forwarded-Prefix" if needed. The default constructor with the existing behaviour of checking both types of headers is still available but deprecated and marked for removal. The new constructor makes forwarded header processing more deterministic and aligned with what is expected from the proxy. Please, see the updated Security Considerations section, as well as related changes in Spring Boot spring-projects/spring-boot#51030. #37072 - Default context config is not detected when superclass or enclosing class is not annotated with
@ContextConfiguration#31456
⭐ New Features
- Add logging operators in DefaultExchangeFunction only when debug is enabled #37095
- Consistently enforce non-null instance in
AbstractFactoryBean#37091 - Reinstate invalid resource location checks #37063
- Preserve original bean names as aliases with
FullyQualifiedConfigurationBeanNameGenerator#37038 - Improve forwarded header parsing #36964
- Avoid "NullAway.Init" suppression in favor of explicit field handling #36961
- Refine and better specify error handling in MultipartParser #36947
- Use double division to calculate applied jitter in
ExponentialBackOff#36943 - Throw
ClassNotFoundExceptionfor missing class resource inThrowawayClassLoader#36938 - Replace
isAssignableFrom()withisInstance()where feasible #36899 - Simplify BUFFER_COUNT in ConcurrentLruCache to a constant #36872
- Apply auto-grow collection limit to direct field binding #36862
- Reject duplicate MIME type parameters #36841
- Add
DataSizeconverters toDefaultConversionService#36830 - Only update
ObservationThreadLocalAccessorwhen a test has an activeApplicationContext#36817 - Deprecate setDisallowedFields in DataBinder for removal #36816
- Optimize ClassNameReader.getClassName via direct ASM API #36814
- AbortedException from client logged at ERROR level with WebFlux functional endpoint #36811
- Add dedicated exception for HttpStatus.PRECONDITION_FAILED #36807
- Reset mocks only when a test has an active
ApplicationContext#36782 - Improve MimeType parser for RFC compliance #36729
- Reject unsafe static resource locations in MVC and WebFlux #36695
- Use
String#replaceinstead ofString#replaceAllwhere appropriate #36678 - Beans created with BeanRegistrar on GenericApplicationContext do not honor allow-bean-definition-overriding setting #36648
- Use defensive
Datecopies forSimpleMailMessagesentDate#36626 - Align
StandardMethodMetadatawith ASM/ClassFile support forgetReturnTypeName()#36619 - Use canonical names in error messages in annotation processing #36607
- Provide bean conditional registration capabilities in
BeanRegistrarDsl#36601 - Align with JDK behavior by throwing
TypeNotPresentExceptionduring annotation processing #36593 - Deprecate RestTemplate and related types #36574
- Remove deprecated
methodIdentification()method inCacheAspectSupport#36560 - Reject unbalanced parentheses in profile expressions #36550
- Introduce
ResolvableType.forParameter()factory method #36545 - Remove redundant
Assert.notNull()checks inResolvableType#36544 - Introduce support for custom parameter names in
ParameterResolutionDelegate#36534 - Perform case-insensitive lookup in
HttpMethod.valueOf()#36518 - Add "application/jsonl" support alongside "application/x-ndjson" for streaming #36485
- Replace HandlerMappingIntrospector with PreFlightRequestHandler bean in MVC config #36481
- GenericTypeResolver.resolveType should resolve TypeVariable with nested ParameterizedType #36480
- Introduce
classpath*:support forResourceLoader#getResourcewith fully specified resource path #36415 - Support for Map body types in FormHttpMessageConverter #36408
- Support compilation of SpEL expressions that use
Optionalwith null-safe and Elvis operators #36330 - Skip Jaxb auto-detection in HttpMessageConverters for servers #36302
- Handle multi-JAR resources in ReloadableResourceBundleMessageSource #36292
- Support for JPA 4.0
@PersistenceAgentinjection #36264 - Move multipart support out of FormHttpMessageConverter #36256
- Introduce MultipartHttpMessageConverter #36255
- Introduce HttpMessageConverter#canWriteRepeatedly #36252
- Override Servlet 6.1's
doPatch()method inFrameworkServlet#36247 - Allow local
@BootstrapWithannotation to override a meta-annotation within the same composed annotation #35938 - Support for JTA 2.1 read-only transaction management #35915
- Add typesafe method to get generic bean by name with type reference #35808
- Support reading multipart requests from RestTestClient in MockMvc #35569
- Use 500 for default exception handling when DisconnectedClientHelper#clientDisconnectedException returns true #34481
- Support reading multipart HTTP messages with a converter #33263
- Provide bean conditional registration capabilities in
BeanRegistrar#21497 - Support
@MockitoBeanand@MockitoSpyBeanon test constructor parameters #36096
🐞 Bug Fixes
- Ignore static get/is accessor methods in PropertyDescriptorUtils #37081
AnnotationDescriptor.findAllLocalMergedAnnotationsfails to find interface annotations #36975- PartGenerator should close the OutputStream when it's done reading the part #36945
- PartGenerator should also clean up the current State in case of failure #36942
- Close class resource
InputStreaminThrowawayClassLoader#36933 - GenericTypeResolver.resolveType picks a sibling interface's binding when two interfaces share a type-variable name (breaks
@RequestBodydeserialization) #36890 - Restore thread interrupt flag in
DefaultMvcResultwhen catchingInterruptedException#36876 - Character outside of permitted range in Content Disposition #36805
- Reinstate Root Servlet context as a valid location #36753
🔨 Dependency Upgrades
- Upgrade Kotlin Coroutines to 1.11 #37076
- Upgrade to Hibernate ORM 7.4 #36519
- Upgrade to Jackson 3.1 and 2.21 #36130
- Upgrade to JUnit 6.1.2 #36815
- Upgrade to Kotlin 2.3.20 #36484
- Upgrade to Kotlin 2.4 #37074
- Upgrade to Kotlin Serialization 1.11.0 #36657
❤️ Contributors
Thank you to all the contributors who worked on this release:
@PaulNgo-BlueOC, @arnabnandy7, @bebeis, @codingkiddo, @cookie-meringue, @daguimu, @dominik-kovacs, @jhan0121, @junhyeong9812, @leestana01, @mkurz, @ngocnhan-tran1996, @quaff, @s-chan-o, @samueldlightfoot, @seregamorph, @shenjianeng, and @yeomin4242