Misplaced Pages

Spring Boot

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Application framework for Java platform
An editor has performed a search and found that sufficient sources exist to establish the subject's notability. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Spring Boot" – news · newspapers · books · scholar · JSTOR (June 2023) (Learn how and when to remove this message)
Spring Boot
Original author(s)Rod Johnson
Developer(s)VMware
Initial releaseApril 2014; 10 years ago (2014-04)
Stable release3.4.0 Edit this on Wikidata / 21 November 2024; 28 days ago (21 November 2024)
Repository
Written inJava
PlatformJava EE
TypeApplication framework
LicenseApache License 2.0
Websitespring.io/projects/spring-boot Edit this on Wikidata

Spring Boot is an open-source Java framework used for programming standalone, production-grade Spring-based applications with a bundle of libraries that make project startup and management easier. Spring Boot is a convention-over-configuration extension for the Spring Java platform intended to help minimize configuration concerns while creating Spring-based applications. The application can still be adjusted for specific needs, but the initial Spring Boot project provides a preconfigured "opinionated view" of the best configuration to use with the Spring platform and selected third-party libraries.

Spring Boot can be used to build microservices, web applications, and console applications.

Features

Bootstrapping DispatcherServlet

See also: Spring Framework § Configuration of DispatcherServlet

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

SpringBootServletInitializer

Spring Boot has a class SpringBootServletInitializer, which is a specialization of the WebApplicationInitializer. 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.

Configuration properties

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

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. 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.

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

@SpringBootConfiguration

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

@EnableAutoConfiguration

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

Actuator

The Spring Boot Actuator allows for monitoring and management capabilities for the Spring Boot Application. 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.

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

Integration with Spring Framework Modules

Spring Boot has a number of existing Spring Framework Modules.

Spring Security

Main article: 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.

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.

Application Servers

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

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.

References

  1. "Spring Boot v1.0.0.RELEASE". github.com.
  2. "Release 3.4.0". 21 November 2024. Retrieved 30 November 2024.
  3. ^ "Spring Boot Tutorial - Learn Spring Boot". GeeksforGeeks. 2023-05-08. Retrieved 2024-04-05.
  4. ^ 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. "Spring Boot Console Application". Baeldung. 2024-01-08. Retrieved 2024-09-20.
  9. ^ Walls 2016, p. 7, §1.1.3.
  10. ^ Walls 2016, p. x, §Preface.
  11. Musib 2022, p. 9, §1.2.1 Maven vs Gradle.
  12. Walls 2016, pp. 4–5, §1.1.2.
  13. ^ Walls 2016, pp. 124–139, §7.
  14. Walls 2016, pp. 49–69, §3.1-§3.2.3.
  15. "Language Support". Spring Framework.
  16. ^ Deinum & Cosmina 2021, pp. 52–54, §2 Spring Framework Fundamentals - Spring Boot.
  17. ^ Walls 2019, pp. 11–17, §1.2.2 Examining the Spring project structure.
  18. ^ 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. ^ 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. ^ Musib 2022, pp. 406–417, §9.2 Deploying Spring Boot application as WAR in the wildfly application server.

External links

Java (software platform)
Platforms
Oracle technologies
Platform technologies
Major third-party
technologies
History
JVM languages
Community
Conferences
Organizations
People
Category   icon Computer programming portal
Categories: