Skip to content

What's New in Spring Framework 6.x

Brian Clozel edited this page Nov 3, 2022 · 157 revisions

What's New in Version 6.0

JDK 17+ and Jakarta EE 9+ Baseline

  • Entire framework codebase based on Java 17 source code level now.
  • Migration from "javax" to "jakarta" namespace for Servlet, JPA, etc.
  • Compatible with latest web container generation: Tomcat 10, Jetty 11.
  • Early compatibility with virtual threads (in preview as of JDK 19).

General Core Revision

Core Container

  • Basic bean property determination without java.beans.Introspector by default.
  • AOT processing support in GenericApplicationContext ("refreshForAotProcessing").
  • Bean definition transformation based on pre-resolved constructors and factory methods.
  • Support for early proxy class determination for AOP proxies and configuration classes.
  • PathMatchingResourcePatternResolver uses NIO and module path APIs for scanning.
  • DefaultFormattingConversionService supports ISO-based default java.time type parsing.

Data Access and Transactions

  • Support for pre-determining JPA managed types (for inclusion in AOT processing).
  • JPA support for Hibernate ORM 6.1 (retaining compatibility with Hibernate ORM 5.6).
  • Upgrade to R2DBC 1.0 (including R2DBC transaction definitions).
  • Removal of JCA CCI support.

Spring Messaging

General Web Revision

Spring MVC

  • PathPatternParser used by default (with the ability to opt into PathMatcher).
  • Removal of outdated Tiles and FreeMarker JSP support.

Spring WebFlux

  • New PartEvent API to stream multipart form uploads (both on client and server).
  • Addition of ResponseEntityExceptionHandler to customize WebFlux exceptions and render RFC 7807 error responses.
  • Flux return values for non-streaming media types (no longer collected to List before written).
  • Early support for Reactor Netty 2 based on Netty 5 alpha.
  • JDK HttpClient integrated with WebClient.

Observability

Direct Observability instrumentation with Micrometer Observation in several parts of the Spring Framework. The "spring-web" module now requires "io.micrometer:micrometer-observation:1.10+" as a compile depedency.

  • RestTemplate and WebClient are instrumented to produce HTTP client request observations
  • Spring MVC can be instrumented for HTTP server observations using the new org.springframework.web.filter.ServerHttpObservationFilter
  • Spring WebFlux can be instrumented for HTTP server observations using the new org.springframework.web.filter.reactive.ServerHttpObservationFilter
  • Integration with Micrometer Context Propagation for Flux and Mono return values from controller methods.

Testing

  • Support for testing AOT-processed application contexts.
  • Integration with HtmlUnit 2.64 request parameter handling.