What Spring Boot is
Hub › Java › Beginner › What Spring Boot is
Goal
Understand what Spring Boot adds on top of plain Java. After this page you will know what @SpringBootApplication and "embedded Tomcat" mean before you see them in code.
Prerequisites
The two parts: Spring and Spring Boot
Spring is a Java framework. It does dependency injection, web request routing, database access, and a long list of other things. A bare Spring application before 2014 required you to wire up a servlet container, write web.xml, configure a DispatcherServlet, and curate every dependency version yourself.
Spring Boot is a layer on top of Spring that removes that ceremony. It gives you three things:
- Auto-configuration. It looks at the libraries on your classpath and configures sensible defaults. Add a web library — you get a web server. Add a database library — you get a connection pool.
- Starter dependencies. Pre-curated dependency bundles.
spring-boot-starter-webpulls in Spring MVC, Jackson (for JSON), and an embedded Tomcat in one line. - Embedded Tomcat. Your app contains the web server. You do not deploy a
.warfile into Tomcat — you runjava -jar app.jarand your app listens on port 8080.
@SpringBootApplication is the single annotation that turns a plain class with a main method into a Spring Boot application. It tells Spring Boot: "scan this package for components, auto-configure everything, and start the embedded server."
For the framework's full reach, see the Spring Boot reference. For this tier we only use @SpringBootApplication, @RestController, and @GetMapping.
What "auto-configuration" means in practice
When you add spring-boot-starter-web to your pom.xml and start the app, Spring Boot:
- Detects Tomcat on the classpath.
- Starts it on port 8080.
- Wires Spring MVC to dispatch HTTP requests to your
@RestControllerclasses. - Wires Jackson to convert your return values to JSON.
You write zero configuration code for any of that. You write only the parts that are specific to your app — the controllers and the data.
We will see the controller on page 9, and Spring Boot will quietly handle every step above.
Next → Create a Spring Boot project