@ -7,97 +7,7 @@ _This document provides a summary of features and changes in Spring Framework [5
@@ -7,97 +7,7 @@ _This document provides a summary of features and changes in Spring Framework [5
## What's New in Version 5.2
### General Core Revision
* Upgrade to ASM 7.1 and Kotlin 1.3.
* Annotation retrieval optimizations:
* New `MergedAnnotations` API for efficient sophisticated annotation retrieval checks.
* Candidate class mechanism for indications about the potential presence of certain annotation types.
* Commons Logging conveniences:
* `LogMessage` for first-class message supplier and argument-based formatting support.
* `LogAccessor` as a convenient `Log` alternative with out-of-the-box support for message suppliers.
### Core Container
* `@Configuration` model improvements:
* Optimized annotation introspection on configuration candidate classes.
* `proxyBeanMethods` attribute for `@Configuration`-demarcated classes in lite mode, i.e. without CGLIB subclasses.
* Support for annotation detection on factory methods with common `ListableBeanFactory` retrieval methods: `getBeanNamesForAnnotation`, `getBeansWithAnnotation`, `findAnnotationOnBean`.
* [Bean registration with Kotlin DSL](https://docs.spring.io/spring/docs/current/spring-framework-reference/languages.html#kotlin-bean-definition-dsl) using callable reference with autowired parameters.
### Transaction Management
* Support for reactive transaction management on Reactive Streams Publishers
* `ReactiveTransactionManager` SPI as alternative to `PlatformTransactionManager`.
* Programmatic `TransactionalOperator` as well as `@Transactional` integration.
* Support for transaction control via Vavr `Try` return type on `@Transactional` methods.
### General Web Revision
* Complete set of `java.time` based setters on `HttpHeaders`, `CacheControl`, `CorsConfiguration`.
support such that if a media type is declared with a specific parameter, and the requested media types (e.g. from "Accept" header) also has that parameter, the parameter values must match. This can be used for example to differentiate methods producing ATOM feeds `"application/atom+xml;type=feed"` vs ATOM entries `"application/atom+xml;type=entry"`.
* CORS revision that adds `Vary` header for non CORS requests on CORS enabled endpoints and avoid considering same-origin requests with an `Origin` header as a CORS request.
* Upgrade to Jackson 2.10
### Spring Web MVC
* New "WebMvc.fn" programming model, analogous to the existing "WebFlux.fn":
* A functional alternative to annotated controllers built on the Servlet API.
* Request mapping performance optimizations through caching of the lookup path per `HandlerMapping`, and pre-computing frequently used data in `RequestCondition` implementations.
* Improved, compact logging of request mappings on startup.
### Spring WebFlux
* Refinements to `WebClient` API to make the `retrieve()` method useful for most common cases, specifically adding the ability to retrieve status and headers and addition to the body. The `exchange()` method is only for genuinely advanced cases, and when using it, applications can now rely on `ClientResponse#createException` to simplify selective handling of exceptions.
* Configurable limits on input stream processing in all `Decoder` and `HttpMessageReader` implementations, with `maxInMemorySize` set to 256K by default. See WebFlux reference for details.
* [Support for Kotlin Coroutines](https://docs.spring.io/spring/docs/current/spring-framework-reference/languages.html#coroutines).
* Server and client now use Reactor [checkpoints](https://projectreactor.io/docs/core/release/reference/#_the_checkpoint_alternative) to insert information about the request URL being processed,sce or the handler used, that is then inserted into exceptions and logged below the exception stacktrace.
* Request mapping performance optimizations through pre-computing frequently used data in `RequestCondition` implementations.
* Header management performance optimizations by wrapping rather than copying server headers, and caching parsed representations of media types. Available from 5.1.1, see issue [#21783](https://github.com/spring-projects/spring-framework/issues/21783) and commits under "Issue Links".
* Improved, compact logging of request mappings on startup.
* Add `ServerWebExchangeContextFilter` to expose the
[Reactor Context](https://projectreactor.io/docs/core/release/reference/#context) as an exchange attribute.
* Add FreeMarker macros support.
* `MultipartBodyBuilder` improvements to allow `Publisher` and `Part` as input along with option to specify the filename to use for a part.
* Response handling via annotated `@MessageMapping` methods.
* Performing requests via `RSocketRequester` with encoding and decoding to and from higher-level objects.
* [Support for Kotlin Coroutines](https://docs.spring.io/spring/docs/current/spring-framework-reference/languages.html#coroutines).
### Testing
* JUnit Jupiter 5.5.2 support.
* New `@TestConstructor` annotation and `spring.test.constructor.autowire.mode` JVM system property for configuring the [autowiring mode for test constructors](https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#integration-testing-annotations-testconstructor) when using JUnit Jupiter.
* Support for built-in [test execution events](https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#testcontext-test-execution-events).
* `@TestPropertySource` can now be used as a [repeatable annotation](https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#declaring-test-property-sources).
* Class-level and method-level `@Sql` declarations can now be [merged](https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#testcontext-executing-sql-declaratively-script-merging).
* `@SqlConfig` now supports [multiple comment prefixes](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/jdbc/SqlConfig.html#commentPrefixes--) for scripts configured via `@Sql`.
* Enhancements to the `TestContext` API:
* New [`hasApplicationContext()`](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/TestContext.html#hasApplicationContext--) method to determine if the application context for the current test is known to be available.
* New [`publishEvent()`](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/TestContext.html#publishEvent-java.util.function.Function-) method for simplified `ApplicationEvent` publication.
* Improved support for setting cookie headers in `MockHttpServletResponse`.
* `MockMvcResultMatchers.jsonPath()` now supports a target type.
* New `headerDoesNotExist()` method in `MockRestServiceServer` to verify that a header does not exist.
* `ReflectionTestUtils` supports the invocation of `static` methods via new [`invokeMethod()`](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/util/ReflectionTestUtils.html#invokeMethod-java.lang.Class-java.lang.String-java.lang.Object...-) variants.
### Documentation
* Code samples in the [reference documentation](https://docs.spring.io/spring/docs/current/spring-framework-reference) are now provided in Kotlin in addition to Java
To see all changes, please check the release notes for individual milestones: