Spring makes it easy to build enterprise applications using Java. It provides everything you need to use the Java language in an enterprise environment, including support for Groovy and Kotlin as alternative languages in the JVM, and offers the flexibility to create many kinds of architectures depending on the needs of the application. Starting with Spring Framework 5.1, Spring requires JDK 8+ (Java SE 8+) and provides native support for JDK 11 LTS. Java SE 8 update 60 is suggested as the minimum valid patch release for Java 8, but it is generally recommended to use the latest patch release.

Spring supports a wide range of use cases. In a large enterprise, applications are often used for long periods of time and must run on the JDK and application server, the update cycle of which is outside the control of the developer. Some can run as a single jar file on an embedded server, possibly in a cloud environment. Others may be standalone applications (such as batch or integration workloads) that do not require a server.

Spring is open source. It has a large and active community that provides constant feedback based on a wide range of real-world use cases. This has helped Spring evolve successfully over a very long time.

What do we mean by "Spring"

The term "Spring" means different things in different contexts. It can be used to refer to the very Spring Framework project that started it all. Over time, other Spring projects were built on top of the Spring Framework. Most often, when people say "Spring", they mean the entire family of projects. This reference documentation focuses on the core: the Spring Framework itself.

The Spring Framework is divided into modules. Applications can choose which modules they need. It is based on the modules of the main container, including the configuration model and the Dependency Injection (DI) mechanism. In addition, the Spring Framework provides basic support for various application architectures, including messaging, transactional data and persistence, and the web. It also includes the servlet-based Spring MVC web framework and, in parallel, the reactive Spring WebFlux web framework.

A note about modules: Spring jars allow you to deploy them to the JDK 9 module path ( "Jigsaw") For use in Jigsaw-enabled applications, Spring Framework 5 jars come with "Automatic-Module-Name" manifest entries that define language-level stable module names ("spring.core", "spring.context", etc.). ), independent of jar artifact names (jar files have the same naming pattern with "-" instead of ".", for example "spring-core" and "spring-context"). Of course, Spring jar files still work fine on the classpath in both JDK 8 and 9+.

History of Spring and the Spring Framework

Spring was born in 2003 as a reaction to the complexity of the early J2EE specifications. Although some consider Java EE and Spring to be competitors, Spring is essentially complementary to Java EE. The Spring programming model does not cover the Java EE platform specification; rather, it integrates with carefully selected individual specifications from the generalized EE:

Spring Framework also supports dependency injection specifications (JSR 330) and general annotations (JSR 250), which application developers can use instead of the Spring-specific mechanisms provided by the Spring Framework.

Starting with Spring Framework 5.0, Spring requires at least Java EE 7 level (for example , Servlet 3.1+, JPA 2.1+), while providing native integration with new APIs at the Java EE 8 level (e.g. Servlet 4.0, JSON Binding API) when encountered at runtime. This makes Spring fully compatible with, for example, Tomcat 8 and 9, WebSphere 9, and JBoss EAP 7.

Java EE's role in application development has evolved over time. In the early days of Java EE and Spring, applications were built to be deployed on an application server. Today, with Spring Boot, applications are built in a devops and cloud friendly way using a built-in servlet container that is easy to modify. As of Spring Framework 5, a WebFlux application doesn't even use the Servlet API directly and can run on servers (like Netty) that are not servlet containers.

Spring continues to innovate and evolve. Apart from the Spring Framework, there are other projects such as Spring Boot, Spring Security, Spring Data, Spring Cloud, Spring Batch, etc. It's important to remember that each project has its own source code repository, issue tracking system, and release frequency for new versions. See spring.io/projects for a complete list of Spring projects.

Design principle

When you learn a framework, it is important to understand not only what it does, but also how it works. Here are the basic principles of how the Spring Framework works:

  • Choice at every level. Spring allows design decisions to be deferred until "as late as possible." For example, you can switch storage solution providers using system settings without changing your code. The same applies to many other infrastructure and third-party API integration issues.
  • Take into account different points of view. Spring is about flexibility and not having a set approach to how things should be done. It offers solutions for a wide range of application needs with different visions.
  • Supports a high level of backward compatibility. Spring's evolution has been carefully designed to accommodate several significant changes between versions. Spring supports a carefully selected set of JDK versions and third-party libraries to make it easy to maintain applications and libraries that depend on Spring.
  • Concern with API design. The Spring team spends a lot of time and effort creating intuitive APIs that remain functional across multiple versions and over many years.
  • High code quality standards. The Spring Framework places a strong emphasis on meaningful, up-to-date, and accurate javadoc. This is one of the very few projects that can claim a clean code structure without circular dependencies between packages.

Feedback and contributions to development

To find answers to practical questions, diagnostics or debugging, we suggest using Stack Overflow. Click here for a list of suggested tags to use on Stack Overflow. If you are absolutely sure there is an issue in the Spring Framework or would like to suggest a feature, please use GitHub Issues.

If you have a solution or suggested fix in mind, you can submit a pull request to Github. However, please be aware that for all but the most trivial issues, we expect the request to be submitted to the issue tracker, where discussions are held and a record is left for future reference

For more details see the guidelines on the top-level project page "CONTRIBUTION TO DEVELOPMENT".

Getting Started

If you are just getting started with Spring, you can start using the Spring Framework by creating an application based on Spring Boot. The Spring Boot project offers a fast (and hard-coded) way to create a production-ready Spring application. It's based on the Spring Framework, favors convention over configuration, and is designed to get you up and running as quickly as possible.

You can use start.spring.io to create a basic project or follow one of the guides at "Getting started", for example "Getting started creating a RESTful web service" . In addition to being easier to digest, these tutorials are very task-specific, and most of them are based on Spring Boot. They also cover other projects in the Spring portfolio that you might want to look into when solving a specific problem.