Skip to content
CalliCoder

36 tutorials

Spring Boot tutorials

Every Spring Boot guide on the site, newest first. Each one is built around code you can run.

Spring Boot is large enough that most problems have three documented solutions and no clear signal about which one you should use. The guides here pick one, build it end to end from an empty project, and explain the trade-off rather than presenting the choice as settled.

The persistence material covers JPA and Hibernate as they behave in practice: what save() actually issues, why an entity graph beats open-in-view, where LazyInitializationException comes from, and what the generated schema looks like. The web material covers REST controllers, validation, error responses using the ProblemDetail type built into Spring 6, pagination and content negotiation. Security covers form login, OAuth2 clients and social sign-in, and issuing your own tokens.

Spring Boot 3 moved the whole framework from javax.* to jakarta.*, which silently breaks code copied from anything written before it. Articles updated for Spring Boot 3 say so, and the imports in the examples are the ones that compile.

Configuration gets its own treatment throughout. Spring Boot has strong opinions and a great many properties, and the difference between a working service and a puzzling one is often a single setting: ddl-auto quietly reshaping a schema, open-in-view holding database connections for the length of a request, or a missing starter making validation annotations inert without any error at all.

The guides also show what Spring generates on your behalf. When Hibernate creates a table, the DDL is printed. When Spring Data implements a repository from an interface, the derived query is explained. Framework behaviour that stays invisible is framework behaviour you cannot debug.

A note on scope: these guides build services, not front ends. Where a browser is needed to demonstrate an endpoint the markup is minimal and the focus stays on the server. Spring Boot is the subject; the client is whatever is quickest to prove the API works.

All Spring Boot tutorials

Frequently asked questions

Which Spring Boot version do these tutorials use?

Spring Boot 3.2 with Java 17 unless the article says otherwise. Both are named at the top of each guide.

Why will an older Spring Boot example not compile?

Spring Boot 3 replaced every `javax.persistence` and `javax.validation` import with `jakarta.*`. The two cannot be mixed in one project.

Do the examples need a real database?

The persistence guides use MySQL or PostgreSQL and give the connection settings. Swapping in H2 for a first run usually needs only a driver and a URL change.

Is there coverage of testing?

Yes — the guides show slice tests with `@WebMvcTest` and `@DataJpaTest` rather than spinning the whole context for every case.

Is ddl-auto=update safe to use?

In development only. It adds tables and columns but never removes or narrows anything, so the schema drifts. Production wants validate plus Flyway or Liquibase.

Should I return entities or DTOs from a controller?

DTOs, as soon as the entity holds anything the client should not see or set. The guides show both and are explicit about the point at which it matters.