Professional Documents
Culture Documents
Spring Boot Annotations - A Guide To Essential Annotations - by Saurabh Kundu - Medium
Spring Boot Annotations - A Guide To Essential Annotations - by Saurabh Kundu - Medium
In this article, we’ll explore the most commonly used Spring Boot
annotations. Let’s begin.
https://medium.com/@saurabh.kundu/spring-boot-annotations-a-guide-to-essential-annotations-b4d18a26763a 3/18
14/04/2024, 19:27 Spring Boot Annotations: A Guide to Essential Annotations | by Saurabh Kundu | Medium
@Qualifier: This annotation is used to specify which bean should be injected when
multiple beans of the same type are available in the Spring application context.
@Primary: This annotation is used to indicate a primary bean when there are
multiple beans of the same type.
@Lazy: This annotation is used to indicate that a bean should be initialized only
when it is first requested by the application. This can help improve performance by
reducing the startup time of the application.
https://medium.com/@saurabh.kundu/spring-boot-annotations-a-guide-to-essential-annotations-b4d18a26763a 4/18
14/04/2024, 19:27 Spring Boot Annotations: A Guide to Essential Annotations | by Saurabh Kundu | Medium
@Service: This annotation is used to indicate a class that provide business logic or
perform complex tasks in an application.
https://medium.com/@saurabh.kundu/spring-boot-annotations-a-guide-to-essential-annotations-b4d18a26763a 5/18
14/04/2024, 19:27 Spring Boot Annotations: A Guide to Essential Annotations | by Saurabh Kundu | Medium
annotations.
https://medium.com/@saurabh.kundu/spring-boot-annotations-a-guide-to-essential-annotations-b4d18a26763a 6/18
14/04/2024, 19:27 Spring Boot Annotations: A Guide to Essential Annotations | by Saurabh Kundu | Medium
@ResponseStatus: This annotation is used to set the HTTP response status code
for a controller method.
https://medium.com/@saurabh.kundu/spring-boot-annotations-a-guide-to-essential-annotations-b4d18a26763a 7/18
14/04/2024, 19:27 Spring Boot Annotations: A Guide to Essential Annotations | by Saurabh Kundu | Medium
https://medium.com/@saurabh.kundu/spring-boot-annotations-a-guide-to-essential-annotations-b4d18a26763a 8/18
14/04/2024, 19:27 Spring Boot Annotations: A Guide to Essential Annotations | by Saurabh Kundu | Medium
@Value: This annotation is used to inject a value from a property source into a
Spring bean. It can be used to retrieve a single value or to inject a collection of
values.
@Import: This annotation brings configuration classes that are defined in other
packages, projects or libraries, into their own Spring configuration class.
https://medium.com/@saurabh.kundu/spring-boot-annotations-a-guide-to-essential-annotations-b4d18a26763a 9/18