Spring Boot

Last updated
Spring Boot
Original author(s) Rod Johnson
Developer(s) VMware
Initial releaseApril 2014;10 years ago (2014-04) [1]
Stable release
3.2.5 [2]   OOjs UI icon edit-ltr-progressive.svg / 18 April 2024;24 days ago (18 April 2024)
Repository
Written in Java
Platform Java EE
Type Application framework
License Apache License 2.0
Website spring.io/projects/spring-boot   OOjs UI icon edit-ltr-progressive.svg

Spring Boot is an open-source Java framework used for programming standalone, production-grade Spring-based applications with minimal effort. [3] Spring Boot is a convention-over-configuration extension for the Spring Java platform intended to help minimize configuration concerns while creating Spring-based applications. [4] [5] Most of the application can be preconfigured using Spring team's "opinionated view" [6] [7] of the best configuration and use of the Spring platform and third-party libraries.

Contents

It is widely used for building microservices, web applications, and other Java-based projects due to its ease of use and robustness.

Features

Bootstrapping DispatcherServlet

Spring Boot does not require manual configuration of the DispatcherServlet, since it automatically configures the application based on the configuration it detects. [16]

SpringBootServletInitializer

Spring Boot has a class SpringBootServletInitializer, which is a specialization of the WebApplicationInitializer. [16] This SpringBootServletInitializer is an out-of-the-box implementation of WebApplicationInitializer, which eliminates the need for the developer to construct their own implementation of the WebApplicationInitializer class. [16]

Configuration properties

The configuration properties for the Spring Boot application can be specified in the application.properties or application.yml file. [16] Examples of properties that can be included in this file include the server.port and spring.application.name properties. [16]

Autoconfiguration

@SpringBootApplication

Spring boot has an annotation, @SpringBootApplication, which allows the Spring Boot application to autoconfigure third-party libraries and detected features found on the classpath. [16] As an example, the class that has the @SpringBootApplication annotation can extend the SpringBootServerInitializer class if the application is packaged and deployed as a WAR file. [16]

The @SpringBootApplication annotation combines three Spring-specific annotations: @SpringBootConfiguration, @EnableAutoConfiguration and @ComponentScan. [17]

@SpringBootConfiguration

The @SpringBootConfiguration annotation is a specialization of the Spring-specific @Configuration annotation. [17] The class with the @SpringBootConfiguration is marked as the configuration class for the Spring Boot application. [17]

@EnableAutoConfiguration

The @EnableAutoConfiguration annotation is Spring-specific annotation that enables the Spring Boot automatic configuration. [17]

Actuator

The Spring Boot Actuator allows for monitoring and management capabilities for the Spring Boot Application. [18] A major advantage of using the Spring Boot Actuator is that it implements a number of production-ready features without requiring the developer to construct their own implementations. [18]

If Maven is used as the build tool, then the spring-boot-starter-actuator dependency can be specified in the pom.xml configuration file. [19]

Integration with Spring Framework Modules

Spring Boot has a number of existing Spring Framework Modules.

Spring Security

Spring Boot has integration with the Spring Security Module. The simplest way for integrating Spring Boot with Spring Security is to declare the starter dependency in the build configuration file. [20]

If Maven is used as the build tool, then the dependency with artifact ID spring-boot-starter-security dependency can be specified in the pom.xml configuration file. [20]

Application Servers

By default, Spring boot provides embedded web servers (such as TomCat) out-of-the-box. [21] However, Spring Boot can also be deployed as a WAR file on a standalone WildFly application server. [22]

If Maven is used as the build tool, there is a wildfly-maven-plugin Maven plugin that allows for automatic deployment of the generated WAR file. [22]

Related Research Articles

JUnit is a test automation framework for the Java programming language. JUnit is often used for unit testing, and is one of the xUnit frameworks.

<span class="mw-page-title-main">Jakarta EE</span> Set of specifications extending Java SE

Jakarta EE, formerly Java Platform, Enterprise Edition and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web services. Jakarta EE applications are run on reference runtimes, which can be microservices or application servers, which handle transactions, security, scalability, concurrency and management of the components they are deploying.

<span class="mw-page-title-main">Jakarta Servlet</span> Jakarta EE programming language class

A Jakarta Servlet, formerly Java Servlet is a Java software component that extends the capabilities of a server. Although servlets can respond to many types of requests, they most commonly implement web containers for hosting web applications on web servers and thus qualify as a server-side servlet web API. Such web servlets are the Java counterpart to other dynamic web content technologies such as PHP and ASP.NET.

The Jakarta Project created and maintained open source software for the Java platform. It operated as an umbrella project under the auspices of the Apache Software Foundation, and all Jakarta products are released under the Apache License. As of December 21, 2011 the Jakarta project was retired because no subprojects were remaining.

A web container is the component of a web server that interacts with Jakarta Servlets. A web container is responsible for managing the lifecycle of servlets, mapping a URL to a particular servlet and ensuring that the URL requester has the correct access-rights. A web container handles requests to servlets, Jakarta Server Pages (JSP) files, and other types of files that include server-side code. The Web container creates servlet instances, loads and unloads servlets, creates and manages request and response objects, and performs other servlet-management tasks. A web container implements the web component contract of the Jakarta EE architecture. This architecture specifies a runtime environment for additional web components, including security, concurrency, lifecycle management, transaction, deployment, and other services.

<span class="mw-page-title-main">Apache Struts 1</span> Open-source web application framework

Apache Struts 1 is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model–view–controller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top-level Apache project in 2005.

Hibernate ORM is an object–relational mapping tool for the Java programming language. It provides a framework for mapping an object-oriented domain model to a relational database. Hibernate handles object–relational impedance mismatch problems by replacing direct, persistent database accesses with high-level object handling functions.

Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. The Maven project is hosted by The Apache Software Foundation, where it was formerly part of the Jakarta Project.

<span class="mw-page-title-main">Apache Tapestry</span> Open-source web application framework

Apache Tapestry is an open-source component-oriented Java web application framework conceptually similar to JavaServer Faces and Apache Wicket. Tapestry was created by Howard Lewis Ship, and was adopted by the Apache Software Foundation as a top-level project in 2006.

Seasar2 is an open-source application framework similar to the Spring Framework (Java). Initially, it was developed for the Java platform by Yasuo Higa, but .NET and PHP platforms are currently supported as well. Seasar2 has a large base of Japanese users, but there is a steady increase of non-Japanese users since English support was announced at the JavaOne 2005 Tokyo conference.

The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. The framework does not impose any specific programming model.. The framework has become popular in the Java community as an addition to the Enterprise JavaBeans (EJB) model. The Spring Framework is free and open source software.

Grails is an open source web application framework that uses the Apache Groovy programming language. It is intended to be a high-productivity framework by following the "coding by convention" paradigm, providing a stand-alone development environment and hiding much of the configuration detail from the developer.

Jakarta Persistence, also known as JPA is a Jakarta EE application programming interface specification that describes the management of relational data in enterprise Java applications.

Apache CXF is an open source software project developing a Web services framework. It originated as the combination of Celtix developed by IONA Technologies and XFire developed by a team hosted at the now defunct host CodeHaus in 2006. These two projects were combined at the Apache Software Foundation. The name "CXF" was derived by combining "Celtix" and "XFire".

Apache Click is a page and component oriented web application framework for the Java language and is built on top of the Java Servlet API.

Java view technologies and frameworks are web-based software libraries that provide the user interface, or "view-layer", of Java web applications. Such application frameworks are used for defining web pages and handling the HTTP requests (clicks) generated by those web pages. As a sub-category of web frameworks, view-layer frameworks often overlap to varying degrees with web frameworks that provide other functionality for Java web applications.

<span class="mw-page-title-main">Spring Roo</span> Open-source software tool

Spring Roo is an open-source software tool that uses convention-over-configuration principles to provide rapid application development of Java-based enterprise software. The resulting applications use common Java technologies such as Spring Framework, Java Persistence API, Thymeleaf, Apache Maven and AspectJ. Spring Roo is a member of the Spring portfolio of projects.

Virgo is an open source, OSGi-based, Java application server. Virgo supports the deployment of OSGi bundles and unmodified Java web applications as well as OSGi-influenced Shared Libraries WARs and Shared Services WARs.

Apache Struts 2 is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model–view–controller (MVC) architecture. The WebWork framework spun off from Apache Struts 1 aiming to offer enhancements and refinements while retaining the same general architecture of the original Struts framework. In December 2005, it was announced that WebWork 2.2 was adopted as Apache Struts 2, which reached its first full release in February 2007.

<span class="mw-page-title-main">Boot (software)</span>

Boot is a build automation and dependency management tool written primarily in the Clojure programming language.

References

  1. "Spring Boot v1.0.0.RELEASE". github.com.
  2. "Release 3.2.5". 18 April 2024. Retrieved 25 April 2024.
  3. "Spring Boot Tutorial - Learn Spring Boot". GeeksforGeeks. 2023-05-08. Retrieved 2024-04-05.
  4. 1 2 Walls 2016, p. vii, §foreword.
  5. Walls 2016, pp. 37–48, §2.3.
  6. Walls 2016, p. 48, §2.4.
  7. Deinum & Cosmina 2021, pp. 21–22, §2 Spring Framework Fundamentals.
  8. 1 2 Walls 2016, p. 7, §1.1.3.
  9. 1 2 Walls 2016, p. x, §Preface.
  10. Musib 2022, p. 9, §1.2.1 Maven vs Gradle.
  11. Walls 2016, pp. 4–5, §1.1.2.
  12. 1 2 Walls 2016, pp. 124–139, §7.
  13. Walls 2016, pp. 49–69, §3.1-§3.2.3.
  14. "Language Support". Spring Framework.
  15. Musib 2022, p. 9, §1.2.2 Java vs Kotlin.
  16. 1 2 3 4 5 6 7 Deinum & Cosmina 2021, pp. 52–54, §2 Spring Framework Fundamentals - Spring Boot.
  17. 1 2 3 4 Walls 2019, pp. 11–17, §1.2.2 Examining the Spring project structure.
  18. 1 2 Musib 2022, pp. 144–145, §4.4 Spring Boot Actuator.
  19. Musib 2022, pp. 145–146, §4.4.1 Configuring Spring Boot Actuator in a Spring Boot application.
  20. 1 2 Musib 2022, pp. 187–192, §5.2.1 Configuring Spring Boot Actuator in a Spring Boot application.
  21. Musib 2022, pp. 7–8, §1.1.4 Spring Boot components.
  22. 1 2 Musib 2022, pp. 406–417, §9.2 Deploying Spring Boot application as WAR in the wildfly application server.