Spring Boot is an open-source Java framework built on top of the Spring Framework, currently maintained by Broadcom (formerly VMware/Pivotal). It's the #10 most-used web framework overall, reported in roughly 14.7% of developer surveys, and the standard choice for production Java applications. Developers reach for it because its auto-configuration and embedded web server eliminate most of the XML and boilerplate setup that made older Spring apps painful to start.
A Spring Boot REST controller uses annotations to map HTTP routes directly onto Java methods, with almost no manual wiring required.
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/items")
public class ItemController {
@GetMapping("/{id}")
public Item getItem(@PathVariable Long id) {
return new Item(id, "Widget", 9.99);
}
@PostMapping
public Item createItem(@RequestBody Item item) {
return item;
}
}
Generate a new Spring Boot project from Spring Initializr (via the web UI or its CLI), then run it with the Maven wrapper.
# generate a project via Spring Initializr CLI (curl-based)
curl https://start.spring.io/starter.zip -d dependencies=web -d type=maven-project -o app.zip
# run the generated project
./mvnw spring-boot:run