What Spring and Spring Boot are
Spring is the most widely used framework for server applications in Java. It handles the routine work: accepting HTTP requests, turning objects into JSON, talking to the database, checking passwords. You are left to write the code that is specific to your task.
Spring and Spring Boot
These are two related projects:
| Project | What it does |
|---|---|
| Spring Framework | The core: creates the application objects and wires them together, handles web requests, manages transactions |
| Spring Boot | A layer on top of Spring: ready-made settings, an embedded web server, start with one command |
Spring applications used to need a lot of manual setup. Spring Boot does it for you: it sees which libraries are on the classpath and switches on sensible default settings for them. This approach is called auto-configuration.
Versions in this course
The course targets Spring Boot 4.1, the current major version. It runs on Spring Framework 7 and needs Java 17 or newer; we use Java 25. The project is built with Maven.
If you find examples for Spring Boot 2 or 3 online, much of them still applies, but the names of some dependencies and packages have changed. Follow the code in this course.
What we will build
One example runs through the whole course — a blog:
- a REST API for posts, comments and users with image uploads and Swagger UI documentation;
- data stored in a database with Spring Data JPA;
- a few HTML pages rendered with the Thymeleaf template engine;
- login with a username and password through Spring Security and JWT tokens for the API;
- tests, including tests on a real PostgreSQL, background jobs, caching and deployment to a server.
The path of a request
Every request to the application goes through the same steps:
- A client (a browser or
curl) sends a request, for exampleGET /api/posts. - The embedded Tomcat server receives it and hands it to Spring.
- Spring finds the controller method responsible for this address.
- The controller calls a service with the application logic.
- The service reads or saves data through a repository.
- The result is turned into JSON or HTML and sent back to the client.
Each step has its own lessons.
What you need to know first
The course is for readers who have finished the Java tutorial: classes, records, collections, lambdas, exceptions and JDBC basics. You should also be comfortable running commands in a terminal. We will test the API with curl — it ships with Windows 10+, macOS and Linux.
Common mistake
Spring and Spring Boot are often confused, and a search for "how to configure Spring" brings up XML instructions from 2010. A modern Spring Boot project needs no XML configuration files: everything is set with annotations in Java code and the application.properties file. If an example you found has applicationContext.xml or web.xml, it belongs to another era.