Spring Version History
1. Spring 1.0 Features
When Spring 1.0 hit the scene, it completely changed how we develop enterprise Java applications. Spring dependency injection and declarative transactions
meant no more tight coupling of components and no more heavyweight EJBs. It couldn’t get any better.
2. Spring 2.0 and Spring 2.5 Features
Spring 2.0 Features
2.1 The Inversion of Control (IoC) container
One of the areas that contains a considerable number of 2.0 and 2.5 improvements is Spring’s IoC container.
2.1.1 New bean scopes
Previous versions of Spring had IoC container level support for exactly two distinct bean scopes (singleton and prototype). Spring 2.0 improves on this by not only providing a number of additional scopes depending on the environment in which Spring is being deployed (for example, request and session scoped beans in a web environment), but also by providing integration points so that Spring users can create their own scopes.
2.1.2 Easier XML configuration
To switch over from the DTD-style to the new XML Schema-style, you need to make the following change.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"> <beans> <!-- <bean/> definitions here --> </beans>
The equivalent file in the XML Schema-style would be…
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <!-- <bean/> definitions here --> </beans>
2.1.3 Extensible XML authoring
XML Authoring an XML schema to describe your custom element(s).
Not only is XML configuration easier to write, it is now also extensible.
What ‘extensible’ means in this context is that you, as an application developer, or (more likely) as a third party framework or product vendor, can write custom tags that other developers can then plug into their own Spring configuration files. This allows you to have your own domain specific language (the term is used loosely here) of sorts be reflected in the specific configuration of your own components.
2.1.4 Annotation-driven configuration
Spring 2.0 introduced support for various annotations for configuration purposes, such as @Transactional, @Required and @PersistenceContext /@PersistenceUnit.
Spring 2.5 introduces support for a complete set of configuration annotations: @Autowired in combination with support for the JSR-250 annotations @Resource, @PostConstruct and @PreDestroy .
2.1.5 Autodetecting components in the classpath
Spring 2.5 introduces support component scanning: autodetecting annotated components in the classpath. Typically, such component classes will be annotated with stereotypes such as @Component, @Repository, @Service, @Controller. Depending on the application context configuration, such component classes will be autodetected and turned into Spring bean definitions, not requiring explicit configuration for each such bean.
2.2 Aspect Oriented Programming (AOP)
Spring 2.0 has a much improved AOP offering. The Spring AOP framework itself is markedly easier to configure in XML, and significantly less verbose as a result; and Spring 2.0 integrates with the AspectJ pointcut language and @AspectJ aspect declaration style.
2.2.1 Easier AOP XML configuration
Spring 2.0 introduces new schema support for defining aspects backed by regular Java objects. This support takes advantage of the AspectJ pointcut language and offers fully typed advice (i.e. no more casting and Object argument manipulation).
2.2.2 Support for @AspectJ aspects
Spring 2.0 also supports aspects defined using the @AspectJ annotations.
2.2.3 Support for bean name pointcut element
Spring 2.5 introduces support for the bean(…) pointcut element, matching specific named beans according to Spring-defined bean names.
2.2.4 Support for AspectJ load-time weaving
Spring 2.5 introduces explicit support AspectJ load-time weaving, as alternative to the proxy-based AOP framework. The new context:load-time-weaver configuration element automatically activates AspectJ aspects as defined in AspectJ’s META-INF/aop.xml descriptor, applying them to the current application context through registering a transformer with the underlying ClassLoader. Note that this only works in environments with class transformation support.
2.3 The Middle Tier
2.3.1 Easier configuration of declarative transactions in XML
The way that transactions are configured in Spring 2.0 has been changed significantly. The previous 1.2.x style of configuration continues to be valid (and supported), but the new style is markedly less verbose and is the recommended style.
2.3.2 Full WebSphere transaction management support
Spring 2.5 explicitly supports IBM’s WebSphere Application Server, in particular with respect to WebSphere’s transaction manager.
Spring 2.0 ships with a JPA abstraction layer that is similar in intent to Spring’s JDBC abstraction layer in terms of scope and general usage patterns.
2.3.4 Asynchronous JMS
Prior to Spring 2.0, Spring’s JMS offering was limited to sending messages and the synchronous receiving of messages. This functionality (encapsulated in the JmsTemplate class) is great, but it doesn’t address the requirement for the asynchronous receiving of messages.
There are some small (but nevertheless notable) new classes in the Spring Framework’s JDBC support library. The first, NamedParameterJdbcTemplate, provides support for programming JDBC statements using named parameters (as opposed to programming JDBC statements using only classic placeholder (‘?’) arguments.
Another of the new classes, the SimpleJdbcTemplate, is aimed at making using the JdbcTemplate even easier to use when you are developing against Java 5+ (Tiger).
Spring 2.5 significantly extends the functionality of SimpleJdbcTemplate and introduces SimpleJdbcCall and SimpleJdbcInsert operation objects.
2.4 The Web Tier
The web tier support has been substantially improved and expanded in Spring 2.0, with annotation-based controllers introduced in Spring 2.5.
2.4.1 Sensible defaulting in Spring MVC
For a lot of projects, sticking to established conventions and having reasonable defaults is just what the projects need… this theme of convention-over-configuration now has explicit support in Spring MVC. What this means is that if you establish a set of naming conventions for your Controllers and views, you can substantially cut down on the amount of XML configuration that is required to setup handler mappings, view resolvers, ModelAndView instances, etc. This is a great boon with regards to rapid prototyping, and can also lend a degree of (always good-to-have) consistency across a codebase.
2.4.2 Portlet framework
Spring 2.0 ships with a Portlet framework that is conceptually similar to the Spring MVC framework.
2.4.3 Annotation-based controllers
Spring 2.5 introduces an annotation-based programming model for MVC controllers, using annotations such as @RequestMapping, @RequestParam, @ModelAttribute, etc.
2.4.4 A form tag library for Spring MVC
A rich JSP tag library for Spring MVC was the JIRA issue that garnered the most votes from Spring users (by a wide margin).
2.4.5 Tiles 2 Support
Spring 2.5 ships support for Tiles 2, the next generation of the popular Tiles templating framework.
2.4.6 JSF 1.2 Support
Spring 2.5 supports JSF 1.2, providing a JSF 1.2 variant of Spring’s DelegatingVariableResolver in the form of the new SpringBeanFacesELResolver.
2.4.7 JAX-WS Support
Spring 2.5 fully supports JAX-WS 2.0/2.1, as included in Java 6 and Java EE 5. JAX-WS is the successor of JAX-RPC, allowing access to WSDL/SOAP-based web services as well as JAX-WS style exposure of web services.
2.5.1 Dynamic language support
Spring 2.0 introduced support for beans written in languages other than Java, with the currently supported dynamic languages being JRuby, Groovy and BeanShell.
2.5.2 Enhanced testing support
Spring 2.5 introduces the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use. The same techniques and annotation-based configuration used in, for example, a JUnit 3.8 environment can also be applied to tests written with JUnit 4.4, TestNG, etc.
2.5.3 JMX support
The Spring Framework 2.0 has support for Notifications; it is also possible to exercise declarative control over the registration behavior of MBeans with an MBeanServer.
2.5.4 Deploying a Spring application context as JCA adapter
Spring 2.5 supports the deployment of a Spring application context as JCA resource adapter, packaged as a JCA RAR file.
2.5.5 Task scheduling
Spring 2.0 offers an abstraction around the scheduling of tasks.
2.5.6 Java 5 (Tiger) support
Find below pointers to documentation describing some of the new Java 5 support in Spring 2.0 and 2.5.
18.104.22.168 “Annotation-based configuration”
22.214.171.124 “Using @Transactional”
126.96.36.199 “@AspectJ support”
188.8.131.52 “Using AspectJ to dependency inject domain objects with Spring”
2.5.7 Dynamic language support
Spring 2.5 Features
2.1 Supported JDK versions
As of Spring 2.5, support for JDK 1.3 has been removed, following Sun’s official deprecation of JDK 1.3 in late 2006. If you haven’t done so already, upgrade to JDK 1.4.2 or higher.
2.2 Jar packaging in Spring 2.5
As of Spring 2.5, Spring Web MVC is no longer part of the ‘spring.jar’ file. Spring MVC can be found in ‘spring-webmvc.jar’ and ‘spring-webmvc-portlet.jar’ in the lib/modules directory of the distribution. Furthermore, the Struts 1.x support has been factored out into ‘spring-webmvc-struts.jar’.
Note: The commonly used Spring’s DispatcherServlet is part of Spring’s Web MVC framework. As a consequence, you need to add ‘spring-webmvc.jar’ (or ‘spring-webmvc-portlet/struts.jar’) to a ‘spring.jar’ scenario, even if you are just using DispatcherServlet for remoting purposes (e.g. exporting Hessian or HTTP invoker services).
Spring 2.0’s ‘spring-jmx.jar’ and ‘spring-remoting.jar’ have been merged into Spring 2.5’s ‘spring-context.jar’ (for the JMX and non-HTTP remoting support) and partly into ‘spring-web.jar’ (for the HTTP remoting support).
Spring 2.0’s ‘spring-support.jar’ has been renamed to ‘spring-context-support.jar’, expressing the actual support relationship more closely. ‘spring-portlet.jar’ has been renamed to ‘spring-webmvc-portlet.jar’, since it is technically a submodule of Spring’s Web MVC framework. Analogously, ‘spring-struts.jar’ has been renamed to ‘spring-webmvc-struts.jar’.
Spring 2.0’s ‘spring-jdo.jar’, ‘spring-jpa.jar’, ‘spring-hibernate3.jar’, ‘spring-toplink.jar’ and ‘spring-ibatis.jar’ have been combined into Spring 2.5’s coarse-granular ‘spring-orm.jar’.
Spring 2.5’s ‘spring-test.jar’ supersedes the previous ‘spring-mock.jar’, indicating the stronger focus on the test context framework. Note that ‘spring-test.jar’ contains everything ‘spring-mock.jar’ contained in previous Spring versions; hence it can be used as a straightforward replacement for unit and integration testing purposes.
Spring 2.5’s ‘spring-tx.jar’ supersedes the previous ‘spring-dao.jar’ and ‘spring-jca.jar’ files, indicating the stronger focus on the transaction framework.
Spring 2.5 ships its framework jars as OSGi-compliant bundles out of the box. This facilitates use of Spring in OSGi environments, not requiring custom packaging anymore.
2.3 XML configuration
Spring 2.0 ships with XSDs that describe Spring’s XML metadata format in a much richer fashion than the DTD that shipped with previous versions. The old DTD is still fully supported, but if possible you are encouraged to reference the XSD files at the top of your bean definition files.
2.4 Deprecated classes and methods
A number of classes and methods that previously were marked as @deprecated have been removed from the Spring 2.0 codebase. The Spring team decided that the 2.0 release marked a fresh start of sorts, and that any deprecated ‘cruft’ was better excised now instead of continuing to haunt the codebase for the foreseeable future.
As mentioned previously, for a comprehensive list of changes, consult the ‘changelog.txt’ file that is located in the top level directory of the Spring Framework distribution.
The following classes/interfaces have been removed as of Spring 2.0:
ResultReader : Use the RowMapper interface instead.
BeanFactoryBootstrap : Consider using a BeanFactoryLocator or a custom bootstrap class instead.
2.5 Apache OJB
As of Spring 2.0, support for Apache OJB was totally removed from the main Spring source tree.
Please note that support for iBATIS SQL Maps 1.3 has been removed.
As of Spring 2.5, support for Hibernate 2.1 and Hibernate 3.0 has been removed. If you haven’t done so already, upgrade to Hibernate 3.1 or higher.
As of Spring 2.5, support for JDO 1.0 has been removed. If you haven’t done so already, upgrade to JDO 2.0 or higher.
Since Spring 2.0, the view name that is determined by the UrlFilenameViewController now takes into account the nested path of the request. This is a breaking change from the original contract of the UrlFilenameViewController, and means that if you are upgrading from Spring 1.x to Spring 2.x and you are using this class you might have to change your Spring Web MVC configuration slightly.
2.10 Updated sample applications
A number of the sample applications have also been updated to showcase the new and improved features of Spring 2.0. So do take the time to investigate them. The aforementioned sample applications can be found in the ‘samples’ directory of the full Spring distribution (‘spring-with-dependencies.[zip|tar.gz]’).
3. Spring 3.0 Features
Then with Spring 3.0 we were given a new Java-based configuration alternative to XML that was improved further in Spring 3.1 with a variety of @Enable-prefixed annotations. For the first time, it become realistic to write a complete Spring
application with no XML configuration whatsoever. It couldn’t get any better.
4. Spring 4.0 Features
4.1 Improved Getting Started Experience
4.2 Removed Deprecated Packages and Methods
4.3 Spring Framework 4.0 provides support for several Java 8 features
4.4 Groovy Bean Definition DSL
4.5 Core Container Improvements
4.6 General Web Improvements
4.7 Testing Improvements
4.8 WebSocket, SockJS, and STOMP Messaging
5. Spring 5.0 (Spring Boot) Features
5.1 JDK baseline update
The entire Spring framework 5.0 codebase runs on Java 8. Therefore, Java 8 is the minimum requirement to work on Spring Framework 5.0.
5.2 Core framework revision
The core Spring Framework 5.0 has been revised to utilize the new features introduced in Java 8.
5.3 Core container updates
Spring Framework 5.0 now supports candidate component index as an alternative to classpath scanning.
5.4 Functional programming with Kotlin
Spring Framework 5.0 introduces support for JetBrains Kotlin language. Kotlin is an object-oriented language supporting functional programming style. Kotlin runs on top of the JVM but is not limited to it.
5.5 Reactive Programming Model
An exciting feature in this Spring release is the new reactive stack Web framework. Being fully reactive and non-blocking, this stack is suitable for event-loop style processing that can scale with a small number of threads.
5.6 Testing improvements
Spring Framework 5.0 fully supports JUnit 5 Jupiter to write tests and extensions in JUnit 5.
5.7 Library support
EhCache 2.10+ / 3.0 GA
5.8 Discontinued support
At the API level, Spring Framework 5.0 has discontinued support for the following packages:
mock.staticmock of the spring-aspects module.
web.view.tiles2M. Now Tiles 3 is the minimum requirement.
orm.hibernate3 and orm.hibernate4. Now, Hibernate 5 is the supported framework
Spring Framework 5.0 has also discontinued support for the following libraries: