Spring
Top 10 Spring Boot Annotations
A reference to Spring Boot annotations for application setup, dependency injection, and web endpoints.
1 view
- @SpringBootApplication: Marks the main class of a Spring Boot application, enabling auto-configuration, component scanning, and configuration.
- @RestController: Indicates a controller class that handles HTTP requests and returns data directly as JSON or XML.
- @Autowired: Automatically injects dependencies into a bean, simplifying dependency management.
- @RequestMapping: Maps HTTP requests to specific handler methods or classes in a controller.
- @GetMapping: Maps HTTP GET requests to a specific method in a controller.
- @PostMapping: Maps HTTP POST requests to a specific method for creating resources.
- @Service: Marks a class as a service component, typically containing business logic.
- @Repository: Indicates a class as a Data Access Object (DAO) for database operations, enabling exception translation.
- @Configuration: Defines a class that provides bean definitions and configuration for the Spring application context.
- @Bean: Declares a method that produces a bean to be managed by the Spring container.