1
1
[[spring-whats-new]]
2
2
= What's New in Spring Framework 4.x
3
3
4
+ This chapter provides an overview of the new features and improvements that have been introduced with Spring Framework 4.3. If you are interested in more details, please see the link:https://jira.spring.io/issues/?jql=project%20%3D%20SPR%20AND%20fixVersion%20in%20(%224.3%20RC1%22%2C%20%224.3%20RC2%22%2C%20%224.3%20GA%22)%20ORDER%20BY%20issuetype%20DESC&startIndex=50[Issue Tracker tickets] that were resolved as part of the 4.3 development process.
5
+
4
6
5
7
[[new-in-4.0]]
6
8
== New Features and Enhancements in Spring Framework 4.0
@@ -220,7 +222,15 @@ Framework 4.0 introduces several new features for use in unit and integration te
220
222
[[new-in-4.1]]
221
223
== New Features and Enhancements in Spring Framework 4.1
222
224
223
- === JMS Improvements
225
+ Version 4.1 included a number of improvements, as described in the following sections:
226
+
227
+ * <<v4_1-JMS-Improvements>>
228
+ * <<v4_1-Caching-Improvements>>
229
+ * <<v4_1-Web-Improvements>>
230
+ * <<v4_1-WebSocket-Messaging-Improvements>>
231
+ * <<v4_1-Testing-Improvements>>
232
+
233
+ === JMS Improvements [[v4_1-JMS-Improvements]]
224
234
Spring 4.1 introduces a much simpler infrastructure <<jms-annotated,to register JMS
225
235
listener endpoints>> by annotating bean methods with
226
236
{api-spring-framework}/jms/annotation/JmsListener.html[`@JmsListener`].
@@ -250,7 +260,7 @@ Finally, Spring 4.1 provides additional miscellaneous improvements:
250
260
{api-spring-framework}/util/backoff/BackOff.html[`BackOff`] implementation
251
261
* JMS 2.0 shared consumers are supported
252
262
253
- === Caching Improvements
263
+ === Caching Improvements [[v4_1-Caching-Improvements]]
254
264
255
265
Spring 4.1 supports <<cache-jsr-107,JCache (JSR-107) annotations>> using Spring's
256
266
existing cache configuration and infrastructure abstraction; no changes are required
@@ -270,7 +280,7 @@ Spring 4.1 also improves its own caching abstraction significantly:
270
280
Spring 4.1 also has a breaking change in the `Cache` interface as a new `putIfAbsent`
271
281
method has been added.
272
282
273
- === Web Improvements
283
+ === Web Improvements [[v4_1-Web-Improvements]]
274
284
275
285
* The existing support for resource handling based on the `ResourceHttpRequestHandler`
276
286
has been expanded with new abstractions `ResourceResolver`, `ResourceTransformer`,
@@ -327,7 +337,7 @@ method has been added.
327
337
support (based on Groovy 2.3). See the `GroovyMarkupConfigurer` and respecitve
328
338
`ViewResolver` and `View' implementations.
329
339
330
- === WebSocket Messaging Improvements
340
+ === WebSocket Messaging Improvements [[v4_1-WebSocket-Messaging-Improvements]]
331
341
332
342
* SockJS (Java) client-side support. See `SockJsClient` and classes in same package.
333
343
* New application context events `SessionSubscribeEvent` and `SessionUnsubscribeEvent` published
@@ -345,7 +355,7 @@ method has been added.
345
355
* Close STOMP/WebSocket connections that have no activity within 60 seconds after the
346
356
WebSocket session is established. See https://jira.spring.io/browse/SPR-11884[SPR-11884].
347
357
348
- === Testing Improvements
358
+ === Testing Improvements [[v4_1-Testing-Improvements]]
349
359
350
360
* Groovy scripts can now be used to configure the `ApplicationContext` loaded for
351
361
integration tests in the TestContext framework.
@@ -384,7 +394,16 @@ method has been added.
384
394
[[new-in-4.2]]
385
395
== New Features and Enhancements in Spring Framework 4.2
386
396
387
- === Core Container Improvements
397
+ Version 4.2 included a number of improvements, as described in the following sections:
398
+
399
+ * <<v4_2-Core-Container-Improvements>>
400
+ * <<v4_2-Data-Access-Improvements>>
401
+ * <<v4_2-JMS-Improvements>>
402
+ * <<v4_2-Web-Improvements>>
403
+ * <<v4_2-WebSocket-Messaging-Improvements>>
404
+ * <<v4_2-Testing-Improvements>>
405
+
406
+ === Core Container Improvements [[v4_2-Core-Container-Improvements]]
388
407
389
408
* Annotations such as `@Bean` get detected and processed on Java 8 default methods as well,
390
409
allowing for composing a configuration class from interfaces with default `@Bean` methods.
@@ -488,7 +507,7 @@ public @interface MyTestConfig {
488
507
exposed through the `lang:std` element in XML. Supports e.g. JavaScript and JRuby.
489
508
(Note: JRubyScriptFactory and `lang:jruby` are deprecated now, in favor of using JSR-223.)
490
509
491
- === Data Access Improvements
510
+ === Data Access Improvements [[v4_2-Data-Access-Improvements]]
492
511
493
512
* `javax.transaction.Transactional` is now supported via AspectJ.
494
513
* `SimpleJdbcCallOperations` now supports named binding.
@@ -498,7 +517,7 @@ public @interface MyTestConfig {
498
517
`<jdbc:embedded-database>` supports a new `database-name` attribute.
499
518
See "Testing Improvements" below for further details.
500
519
501
- === JMS Improvements
520
+ === JMS Improvements [[v4_2-JMS-Improvements]]
502
521
503
522
* The `autoStartup` attribute can be controlled via `JmsListenerContainerFactory`.
504
523
* The type of the reply `Destination` can now be configured per listener container.
@@ -507,7 +526,7 @@ public @interface MyTestConfig {
507
526
* `@JmsListener` is now a repeatable annotation to declare several JMS containers on the same
508
527
method (use the newly introduced `@JmsListeners` if you're not using Java8 yet).
509
528
510
- === Web Improvements
529
+ === Web Improvements [[v4_2-Web-Improvements]]
511
530
512
531
* HTTP Streaming and Server-Sent Events support, see <<mvc-ann-async-http-streaming>>.
513
532
* Built-in support for CORS including global (MVC Java config and XML namespace) and
@@ -540,7 +559,7 @@ public @interface MyTestConfig {
540
559
* Introduced `ScriptTemplateView` as a JSR-223 based mechanism for scripted web views,
541
560
with a focus on JavaScript view templating on Nashorn (JDK 8).
542
561
543
- === WebSocket Messaging Improvements
562
+ === WebSocket Messaging Improvements [[v4_2-WebSocket-Messaging-Improvements]]
544
563
545
564
* Expose presence information about connected users and subscriptions:
546
565
** new `SimpUserRegistry` exposed as a bean named "userRegistry".
@@ -556,7 +575,7 @@ public @interface MyTestConfig {
556
575
`@MessageMapping` and `@SubscribeMapping` methods.
557
576
* `MarshallingMessageConverter` for XML payloads.
558
577
559
- === Testing Improvements
578
+ === Testing Improvements [[v4_2-Testing-Improvements]]
560
579
561
580
* JUnit-based integration tests can now be executed with JUnit rules instead of the
562
581
`SpringJUnit4ClassRunner`. This allows Spring-based integration tests to be run with
@@ -620,7 +639,18 @@ public @interface MyTestConfig {
620
639
[[new-in-4.3]]
621
640
== New Features and Enhancements in Spring Framework 4.3
622
641
623
- === Core Container Improvements
642
+ Version 4.3 included a number of improvements, as described in the following sections:
643
+
644
+ * <<v4_3-Core-Container-Improvements>>
645
+ * <<v4_3-Data-Access-Improvements>>
646
+ * <<v4_3-Caching-Improvements>>
647
+ * <<v4_3-JMS-Improvements>>
648
+ * <<v4_3-Web-Improvements>>
649
+ * <<v4_3-WebSocket-Messaging-Improvements>>
650
+ * <<v4_3-Testing-Improvements>>
651
+ * <<v4_3-Support-for-new-library-and-server-generations>>
652
+
653
+ === Core Container Improvements [[v4_3-Core-Container-Improvements]]
624
654
625
655
* Core container exceptions provide richer metadata to evaluate programmatically.
626
656
* Java 8 default methods get detected as bean property getters/setters.
@@ -640,12 +670,12 @@ public @interface MyTestConfig {
640
670
custom _composed annotations_ with attribute overrides.
641
671
* `@Scheduled` is properly supported on beans of any scope.
642
672
643
- === Data Access Improvements
673
+ === Data Access Improvements [[v4_3-Data-Access-Improvements]]
644
674
645
675
* `jdbc:initialize-database` and `jdbc:embedded-database` support a configurable
646
676
separator to be applied to each script.
647
677
648
- === Caching Improvements
678
+ === Caching Improvements [[v4_3-Caching-Improvements]]
649
679
650
680
Spring 4.3 allows concurrent calls on a given key to be synchronized so that the
651
681
value is only computed once. This is an opt-in feature that should be enabled via
@@ -662,13 +692,13 @@ Spring 4.3 also improves the caching abstraction as follows:
662
692
* `@Cacheable`, `@CacheEvict`, `@CachePut`, and `@Caching` may now be used as
663
693
_meta-annotations_ to create custom _composed annotations_ with attribute overrides.
664
694
665
- === JMS Improvements
695
+ === JMS Improvements [[v4_3-JMS-Improvements]]
666
696
667
697
* `@SendTo` can now be specified at the class level to share a common reply destination.
668
698
* `@JmsListener` and `@JmsListeners` may now be used as _meta-annotations_ to create
669
699
custom _composed annotations_ with attribute overrides.
670
700
671
- === Web Improvements
701
+ === Web Improvements [[v4_3-Web-Improvements]]
672
702
673
703
* Built-in support for <<mvc-ann-requestmapping-head-options,HTTP HEAD and HTTP OPTIONS>>.
674
704
* New `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, and `@PatchMapping`
@@ -691,11 +721,11 @@ Spring 4.3 also improves the caching abstraction as follows:
691
721
* `RestTemplate` and `AsyncRestTemplate` support strict URI variable encoding via `DefaultUriTemplateHandler`.
692
722
* `AsyncRestTemplate` supports request interception.
693
723
694
- === WebSocket Messaging Improvements
724
+ === WebSocket Messaging Improvements [[v4_3-WebSocket-Messaging-Improvements]]
695
725
696
726
* `@SendTo` and `@SendToUser` can now be specified at class-level to share a common destination.
697
727
698
- === Testing Improvements
728
+ === Testing Improvements [[v4_3-Testing-Improvements]]
699
729
700
730
* The JUnit support in the _Spring TestContext Framework_ now requires JUnit 4.12 or higher.
701
731
* New `SpringRunner` _alias_ for the `SpringJUnit4ClassRunner`.
@@ -724,7 +754,7 @@ Spring 4.3 also improves the caching abstraction as follows:
724
754
whether the order of declaration for expectations should be ignored (see <<spring-mvc-test-client>>).
725
755
* Client-side REST Test supports expectations for form data in the request body.
726
756
727
- === Support for new library and server generations
757
+ === Support for new library and server generations [[v4_3-Support-for-new-library-and-server-generations]]
728
758
729
759
* Hibernate ORM 5.2 (still supporting 4.2/4.3 and 5.0/5.1 as well, with 3.6 deprecated now)
730
760
* Hibernate Validator 5.3 (minimum remains at 4.3)
0 commit comments