To specify that a bean should only be created under a specific condition, you would use the _____ annotation in Spring Boot.

  • @ConditionalBean
  • @ConditionalOnProperty
  • @ConditionalOnClass
  • @ConditionalOnCondition
In Spring Boot, the "@ConditionalOnProperty" annotation is used to specify that a bean should be created only under a specific condition based on the values of specified properties. This is a powerful feature that allows developers to control bean creation based on property values, making the application's configuration more flexible and adaptable. The other options are not the correct annotations for this purpose.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *