Spring Study Guide Tutorials
The questions you need to be able to answer about Spring — the container and dependency injection, AOP, transactions and JPA, Spring MVC and REST, security and testing — answered against Spring Framework 7 and Spring Boot 4, with every example lifted from a real pizza ordering API.
- Spring Study Guide – TestingWhen a test needs Spring and when it does not. Plain unit tests with Mockito, the cached test context and what silently evicts it, slice tests versus @SpringBootTest, @MockitoBean, why a @Transactional test rolls back by default, testing controllers with MockMvc and a whole API over a real port — every example from a suite that runs green.
- Spring Study Guide – SecurityAuthentication, authorisation, and the filter chain that implements both. How a request travels through the filters, what the SecurityContext holds and how it is cleared, password hashing and salting, matcher ordering and the mistake that silently opens an endpoint, method security with @PreAuthorize, stateless JWT auth, and the lambda DSL that replaced every old configuration answer.
- Spring Study Guide – RESTREST as Spring implements it. Resources, the safe and idempotent methods and why the distinction matters, status codes for each verb, @RestController versus @Controller, @RequestBody and @ResponseBody, HttpMessageConverters and how content negotiation picks one, error responses with @ControllerAdvice, and RestClient — the replacement for the RestTemplate every old answer names.
- Spring Study Guide – Web LayerSpring MVC end to end. What the DispatcherServlet does with a request, the six delegates it hands off to, how a URL reaches a method, the controller method parameters and return types worth knowing, the Model and where the view gets it, view resolution, the web scopes, and why the whole design is testable without a servlet container.
- Spring Study Guide – Spring BootWhat Spring Boot adds to Spring and what it does not. Starters and why one dependency drags in twelve, how auto-configuration decides, what @SpringBootApplication expands to, where component scanning starts, the property source order in full, embedded servers versus a WAR, and the Boot 3 to Boot 4 changes that turn a working answer into a wrong one.
- Spring Study Guide – Data IntegrationData access, transactions and JPA. Why Spring's exception hierarchy is unchecked, what JdbcTemplate does with a connection, what @Transactional actually generates, the seven propagation modes and the four isolation levels, the default rollback rule and how to change it, the persistence context and when it flushes, and how a Spring Data repository interface becomes a working implementation.
- Spring Study Guide – AOPCross-cutting concerns, and the vocabulary you are expected to use precisely: join point, pointcut, advice, aspect, weaving. The five advice types and when each runs, the pointcut expressions worth memorising, what JoinPoint and ProceedingJoinPoint give you, the self-invocation limitation that catches everyone — and the Boot 4 starter rename that breaks every old pom.
- Spring Study Guide – Core SpringThe container, and everything that lives in it. What dependency injection buys you, how an ApplicationContext starts and stops, the full bean lifecycle in the order it actually runs, the five scopes, component scanning, @Bean versus @Component, resolving ambiguity with @Qualifier and @Primary, profiles, @Value and SpEL, and the two proxy types Spring can create.
- Spring Study Guide – Get StartedStart here. What this guide is, who it is for, and the exact versions every answer is written against — Spring Framework 7 and Spring Boot 4.1 on Java 21. The eight topic areas in reading order, the pizza ordering API every snippet is lifted from, and the short list of things that changed between Spring 5 and Spring 7 that will make an old answer wrong.