Spring Core · companion to Java Core & Service Core

Spring Framework & Boot — from IoC to production

Not just how to annotate a controller—how the container wires beans, how auto-configuration decides what runs, why your @Transactional sometimes silently fails, and what actually happens when SpringApplication.run() starts Tomcat on port 8080.

Why Spring dominates enterprise Java

Spring is not one framework—it is a composable ecosystem built on a single idea: inversion of control with a mature container that wires dependencies, applies cross-cutting concerns via AOP, and integrates every datastore, message broker, and security provider teams already run in production.

  • IoC container

    Objects don't construct their dependencies—the container injects them. Testability, modularity, and consistent lifecycle management follow.

  • Sensible defaults

    Spring Boot auto-configures Tomcat, Jackson, JPA, and Actuator from classpath signals—ship a JAR, not a 200-line XML deployment descriptor.

  • Integration breadth

    JDBC, JPA, Kafka, Redis, OAuth2, Batch, WebFlux—one programming model, one transaction abstraction, one security filter chain.

  • Enterprise adoption

    Banks, insurers, and SaaS backends standardize on Spring Boot 3 + Java 17/21. Job postings, libraries, and hiring pools assume it.

Spring Framework vs Spring Boot

Boot is not a replacement for the Framework—it is opinionated auto-configuration and production-ready defaults on top of the same core container.

LayerSpring FrameworkSpring Boot adds
CoreIoC, DI, AOP, events, SpEL, validationAuto-configured beans via @EnableAutoConfiguration
WebSpring MVC, WebFlux, REST, filtersEmbedded Tomcat/Jetty/Undertow, error pages, static resources
DataJdbcTemplate, ORM integration, transactionsDataSource auto-config, Flyway/Liquibase hooks, HikariCP defaults
OpsManual wiring of metrics, healthActuator, Micrometer, graceful shutdown, config binding
DeployWAR to external servlet containerExecutable fat JAR, cloud-native 12-factor defaults
🔬 Under the Hood

@SpringBootApplication = @Configuration + @EnableAutoConfiguration + @ComponentScan. Boot still uses the same ApplicationContext refresh—you just skip writing 40 configuration classes by hand.

Spring ecosystem map

Projects you will encounter in production codebases—this guide focuses on the bolded core path first.

Foundation

  • Spring Core — IoC container, DI, events, SpEL, validation
  • Spring AOP — proxies, aspects, @Transactional, @Cacheable
  • Spring Boot — auto-configuration, Actuator, embedded servers

Web & API

  • Spring Web MVCDispatcherServlet, REST controllers
  • Spring WebFlux — reactive stack, WebClient, RouterFunction
  • Spring GraphQL, Spring HATEOAS

Data & messaging

  • Spring Data JPA — repositories, query methods, projections
  • Spring Data Redis / Mongo / Elasticsearch
  • Spring Kafka, Spring AMQP (RabbitMQ)
  • Spring Batch — chunk-oriented jobs

Security & cloud

  • Spring Security — filter chain, OAuth2, JWT, method security
  • Spring Cloud — config, gateway, discovery (see Service Core)
  • Spring Session, Spring Integration

Spring Boot release timeline

Boot tracks Spring Framework releases. Production baselines today: Boot 3.2+ on Java 17 minimum, Java 21 for virtual threads.

  1. 2014

    Boot 1.0

    Executable JAR revolution. spring.factories auto-config. Spring 4 baseline.

  2. 2018

    Boot 2.0

    Spring 5, Java 8+, reactive WebFlux support, Actuator overhaul, Micrometer metrics.

  3. 2021

    Boot 2.7 (LTS line end)

    Last 2.x open-source support. Still common in legacy estates migrating to Jakarta.

  4. 2022

    Boot 3.0 — Jakarta EE 9

    Spring 6, javax.*jakarta.*, Java 17 baseline, native observability with Micrometer Tracing, Security 6 lambda DSL.

  5. 2023

    Boot 3.2 — Virtual threads

    Java 21 virtual thread support for Tomcat and @Async. AutoConfiguration.imports replaces spring.factories for auto-config.

🔖 Version Note

New guides default to Spring Boot 3.x / Spring Framework 6 with Jakarta APIs. Boot 2.x callouts appear where migration matters (WebSecurityConfigurerAdapter, Sleuth vs Micrometer Tracing).

Quick start — Initializr to first REST endpoint

Use start.spring.io: Maven, Java 21, Spring Boot 3.2+, dependency Spring Web. Ten lines to a running API.

DemoApplication.java
@SpringBootApplication
public class DemoApplication {
  public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
  }
}

@RestController
class HelloController {
  @GetMapping("/api/hello")
  public Map<String, String> hello() {
    return Map.of("message", "Hello, Spring Core!");
  }
}

Run: ./mvnw spring-boot:runcurl localhost:8080/api/hello

💡 Pro Tip

Add Spring Boot DevTools in dev for automatic restart on classpath change—never include in production dependencies.

How Spring Boot starts — condensed sequence

What happens between main and "Started DemoApplication in 2.3 seconds". Full deep dive in Boot Internals.

sequenceDiagram
  participant Main as main method
  participant SA as SpringApplication
  participant Ctx as ApplicationContext
  participant Tom as Embedded Tomcat
  Main->>SA: run DemoApplication.class
  SA->>SA: prepare Environment and profiles
  SA->>Ctx: refresh context
  Ctx->>Ctx: register beans and auto-config
  Ctx->>Tom: start web server
  SA->>SA: ApplicationReadyEvent
  1. SpringApplication.run() — bootstrap, banner, environment prep
  2. Create ApplicationContext — servlet (MVC) vs reactive (WebFlux)
  3. refresh() — parse config, register bean definitions, instantiate singletons
  4. Auto-configuration — conditional beans from classpath (DataSource, Jackson, etc.)
  5. Embedded server start — Tomcat binds port, registers DispatcherServlet
  6. Runners & events — ApplicationRunner beans, ApplicationReadyEvent

Explore the guide — all sections

Fourteen deep-dive chapters plus cheat sheets. Path: IoC & DIBoot internalsWeb MVCData & Security, then advanced topics.

Learning path: IoC & DI · Boot Internals · Web MVC · Spring Data · Security

Junior

junior

IoC, REST, JPA basics, first Boot app, common annotations.

Mid-Level

mid

Security, transactions, testing slices, caching, async, Boot config.

Senior

senior

Container internals, AOP proxies, production tuning, WebFlux trade-offs.

🎯 Interview Tip

Be ready to explain the difference between IoC (container controls object creation) and DI (dependencies supplied from outside)—and why constructor injection is preferred over field injection.