The @Service annotation in Spring Boot is a specialized form of the _____ annotation used to indicate service components.
- @Bean
- @Component
- @Controller
- @Repository
The @Service annotation in Spring Boot is a specialized form of the @Component annotation used to indicate service components. It is used to define a class as a service in the Spring application context. While @Repository is used for DAOs, @Controller is used for controllers, and @Bean is a more generic annotation for creating managed beans. The @Service annotation provides additional semantic meaning to the class.
Loading...
Related Quiz
- What is the role of the @Repository annotation in the context of database interaction and exception translation?
- Your Spring Boot application requires custom handling of specific exceptions, with different response bodies for each exception type. How would you implement this while ensuring that unhandled exceptions are also adequately addressed?
- To include additional configuration files in a Spring Boot project, the _____ property can be used.
- The _____ endpoint in OAuth2 is used by the client to obtain an access token.
- How can you handle exceptions at the @RestController level, and how is it different from using @ControllerAdvice?