Spring Learning Path
Build one working example at a time. Each stage has its own lesson, runnable project and terminology recap.
New to Java web applications? Begin with Servlets and JSPs Foundation. For each stage, use JDK 21+ and Maven 3.9+, open the project’s pom.xml folder, and follow that stage’s connection and port instructions.
Prerequisites and starting a project
mvn spring-boot:run and keep the terminal open. Stop the previous stage with Ctrl+C before starting another on the same port.server.port=8081If 8081 is occupied, use another available value such as 8082. Save and restart. The browser address must use your chosen port. Stage 5 defaults to 8084, Stage 6 to 8085, and Stage 7 to 8082.
Web application basics
Serve pages, handle requests, read inputs and render templates.
serve Home and About Us as static HTML
A focused example with complete files, expected results and the concepts used in Stage 1.
Open lesson →Stage 2let a controller handle a request
A focused example with complete files, expected results and the concepts used in Stage 2.
Open lesson →Stage 3read two query parameters and return their sum
A focused example with complete files, expected results and the concepts used in Stage 3.
Open lesson →Stage 4read numbers from the URL path
A focused example with complete files, expected results and the concepts used in Stage 4.
Open lesson →Stage 5submit a form and return the answer directly
A focused example with complete files, expected results and the concepts used in Stage 5.
Open lesson →Stage 6introduce Model and Thymeleaf with a product catalog
A focused example with complete files, expected results and the concepts used in Stage 6.
Open lesson →Stage 7apply Model and Thymeleaf to the calculator
A focused example with complete files, expected results and the concepts used in Stage 7.
Open lesson →Application structure and database
Connect components, services, repositories, bean configuration and MongoDB.
Let Spring supply a product-file reader
A focused example with complete files, expected results and the concepts used in Stage 8.
Open lesson →Stage 9Move a product rule into a service
A focused example with complete files, expected results and the concepts used in Stage 9.
Open lesson →Stage 10Put data access behind a repository
A focused example with complete files, expected results and the concepts used in Stage 10.
Open lesson →Stage 11Store and change products in MongoDB
A focused example with complete files, expected results and the concepts used in Stage 11.
Open lesson →Stage 12Create beans with explicit factory methods
A focused example with complete files, expected results and the concepts used in Stage 12.
Open lesson →Stage 13connect the Stage 12 application to MongoDB Atlas
A focused example with complete files, expected results and the concepts used in Stage 13.
Open lesson →Complete application
Bring the concepts together in the Todo list used by the later MVC manual.
How Spring supplies objects
Observe injection, component discovery and container interfaces.
show the product count using constructor injection
A focused example with complete files, expected results and the concepts used in Stage 15.
Open lesson →Stage 16create a product report with an optional confirmation message
A focused example with complete files, expected results and the concepts used in Stage 16.
Open lesson →Stage 17show delivery information from a service in another package
A focused example with complete files, expected results and the concepts used in Stage 17.
Open lesson →Stage 18keep a demo delivery page out of component scanning
A focused example with complete files, expected results and the concepts used in Stage 18.
Open lesson →Stage 19inspect the product application with BeanFactory and ApplicationContext
A focused example with complete files, expected results and the concepts used in Stage 19.
Open lesson →Object scopes and lifecycle
Compare object reuse, on-demand resolution and lifecycle callbacks.
compare singleton and prototype lookups
A focused example with complete files, expected results and the concepts used in Stage 20.
Open lesson →Stage 21observe a prototype captured by a singleton
A focused example with complete files, expected results and the concepts used in Stage 21.
Open lesson →Stage 22obtain a fresh draft for each operation
A focused example with complete files, expected results and the concepts used in Stage 22.
Open lesson →Stage 23observe bean initialization and shutdown
A focused example with complete files, expected results and the concepts used in Stage 23.
Open lesson →Properties and environments
Supply configuration values and select beans by profile.
read a catalog setting with @Value
A focused example with complete files, expected results and the concepts used in Stage 24.
Open lesson →Stage 25load a separate catalog.properties file
A focused example with complete files, expected results and the concepts used in Stage 25.
Open lesson →Stage 26select a catalog source with a profile
A focused example with complete files, expected results and the concepts used in Stage 26.
Open lesson →Inside a web request
Trace HTML, JSON, filters and MVC interceptors.
trace a request to a Thymeleaf page
A focused example with complete files, expected results and the concepts used in Stage 27.
Open lesson →Stage 28return the same products as JSON
A focused example with complete files, expected results and the concepts used in Stage 28.
Open lesson →Stage 29observe requests with a Servlet filter
A focused example with complete files, expected results and the concepts used in Stage 29.
Open lesson →Stage 30observe handler execution with an interceptor
A focused example with complete files, expected results and the concepts used in Stage 30.
Open lesson →AOP and proxy boundaries
Add advice, measure methods and observe self-invocation.
add logging advice to a service
A focused example with complete files, expected results and the concepts used in Stage 31.
Open lesson →Stage 32measure a method with @LogExecutionTime
A focused example with complete files, expected results and the concepts used in Stage 32.
Open lesson →Stage 33observe the self-invocation boundary
A focused example with complete files, expected results and the concepts used in Stage 33.
Open lesson →MongoDB transactions
Verify atomic writes, rollback rules and transaction propagation.
save a todo and activity atomically
A focused example with complete files, expected results and the concepts used in Stage 34.
Open lesson →Stage 35compare checked and unchecked rollback
A focused example with complete files, expected results and the concepts used in Stage 35.
Open lesson →Stage 36join a transaction with REQUIRED
A focused example with complete files, expected results and the concepts used in Stage 36.
Open lesson →Stage 37keep an audit attempt with REQUIRES_NEW
A focused example with complete files, expected results and the concepts used in Stage 37.
Open lesson →Go deeper when a term needs explanation
Click an underlined word for a quick explanation in the right column. Open the full concept guide for detailed examples. Each stage ends with links to its relevant concepts.
Open Spring Concepts →