Core Spring
@Component
Marks a class as a Spring-managed bean so it can be automatically created and injected.
@Service
Used for business logic classes; it’s a specialized form of @Component.
@Autowired
Tells Spring to automatically inject a required dependency.
@Bean
Defines a bean inside a configuration class.
@Configuration
Marks a class that contains Spring bean definitions.
@Primary
Marks a bean as the default choice when multiple beans are available.
@Qualifier
Used when multiple beans exist to specify which one should be injected.
@Repository
“Used for data access classes and also enables automatic exception translation.
@Controller
Marks a class as a web controller that handles HTTP requests.
@RestController
A controller that returns data (usually JSON) instead of views.
Spring Boot
@SpringBootApplication
Main annotation that enables auto-configuration, component scanning, and configuration support.
@EnableAutoConfiguration
Allows Spring Boot to automatically configure beans based on the project setup.
@ComponentScan
Tells Spring where to look for components.
@Value
Used to read values from application.properties.
Top comments (0)