Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications

Categories

🎓 Certifications
🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
CheatGrid
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications
LVLEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Spring Boot Cheat Sheet

Spring Boot Cheat Sheet

Back to Backend Development
Updated 2026-04-29
Next Topic: Webhook Design and Implementation Cheat Sheet

Spring Boot is an opinionated framework built on top of the Spring Framework that simplifies Java application development by providing auto-configuration, embedded servers, and production-ready features out of the box. It eliminates the need for extensive XML configuration and boilerplate code, enabling developers to create stand-alone, production-grade applications with minimal setup. Spring Boot's philosophy centers on convention over configuration, allowing you to quickly bootstrap microservices, REST APIs, and enterprise applications while maintaining the flexibility to override defaults when needed. With Spring Boot 3.x requiring Java 17+ and Jakarta EE 9+, the framework now natively supports GraalVM native images, virtual threads (Project Loom), and the Micrometer observability stack, making it well-suited for cloud-native, high-concurrency workloads.

What This Cheat Sheet Covers

This topic spans 27 focused tables and 178 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Core AnnotationsTable 2: REST API AnnotationsTable 3: Dependency Injection PatternsTable 4: Spring Data JPA Entity AnnotationsTable 5: JPA Relationship MappingsTable 6: Spring Data JPA Repository MethodsTable 7: Validation AnnotationsTable 8: Exception HandlingTable 9: Configuration PropertiesTable 10: Transaction ManagementTable 11: Caching AnnotationsTable 12: Scheduling and AsyncTable 13: Spring Boot StartersTable 14: Actuator EndpointsTable 15: Testing AnnotationsTable 16: Bean Scopes and LifecycleTable 17: AOP (Aspect-Oriented Programming)Table 18: HTTP ClientsTable 19: Event HandlingTable 20: Conditional Bean CreationTable 21: CORS ConfigurationTable 22: Interceptors and FiltersTable 23: File UploadTable 24: Connection PoolingTable 25: AuditingTable 26: Observability and TracingTable 27: GraalVM Native Image and AOT

Table 1: Core Annotations

Spring runs on annotations, and these are the ones you'll type in nearly every class. They split into two jobs — declaring beans (the stereotype annotations like @Component, @Service, @Repository, plus @Configuration and @Bean) and wiring those beans together (@Autowired, @Qualifier, @Primary, @Value). Get these straight and the rest of the framework starts to make sense.

AnnotationExampleDescription
@SpringBootApplication
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
Combines @Configuration, @EnableAutoConfiguration, and @ComponentScan — marks the main entry point and triggers auto-configuration based on classpath dependencies.
@RestController
@RestController
public class UserController {
@GetMapping("/users")
public List<User> getUsers() {...}
}
• Combines @Controller and @ResponseBody
• marks a class as a RESTful controller and automatically serializes return values to JSON/XML.
@Component
@Component
public class EmailService {
public void send(String msg) {...}
}
Marks a class as a Spring-managed bean — automatically detected via classpath scanning and registered in the application context.
@Service
@Service
public class UserService {
public User findById(Long id) {...}
}
Specialization of @Component for service-layer classes containing business logic — semantically signals intent.
@Repository
@Repository
public interface UserRepository extends JpaRepository<User, Long> {}
Specialization of @Component for data-access classes — enables exception translation from database errors to Spring's DataAccessException hierarchy.
@Configuration
@Configuration
public class AppConfig {
@Bean
public DataSource dataSource() {...}
}
Indicates a class declares @Bean methods that Spring processes at runtime to generate bean definitions.
@Bean
@Bean
public RestClient restClient() {
return RestClient.create();
}
Declares a method that produces a Spring-managed bean — used within @Configuration classes to define custom beans.
@Autowired
private final UserService userService;
public UserController(UserService userService) {
this.userService = userService;
}
Enables automatic dependency injection by type — prefer constructor injection (shown) over field injection for testability and immutability.

More in Backend Development

  • Serverless Backend Patterns Cheat Sheet
  • Webhook Design and Implementation Cheat Sheet
  • _Elysia_Framework_for_Bun
  • Backend Error Handling and Recovery Patterns Cheat Sheet
  • Express.js Cheat Sheet
  • Laravel PHP Framework Cheat Sheet
View all 53 topics in Backend Development