To create conditional beans within custom Auto Configuration, you can use the @_____ annotation with a specific condition.
- ConditionalOnBean
- ConditionalOnClass
- ConditionalOnMethod
- ConditionalOnProperty
To create conditional beans within custom Auto Configuration, you can use the @ConditionalOnClass annotation. This annotation allows you to specify that a particular bean should be created only if a specified class is present in the classpath. It's useful for scenarios where you want to conditionally configure beans based on the availability of certain classes.
Loading...
Related Quiz
- You are tasked with implementing a consistent error response structure across multiple microservices developed using Spring Boot. How would you ensure that all the microservices return error responses in the same format?
- When creating a Custom Validator in Spring Boot, the isValid method must return _____ to indicate whether the value meets the constraint.
- The _____ method in Spring Boot reactive programming is used to transform the items emitted by a Publisher.
- In Spring Boot, what is the significance of the @Repository annotation, and how is it different from @Component?
- Which of the following is true about the deleteById method of a JpaRepository?