In which scenario would you use the @ConditionalOnProperty annotation in Auto Configuration?

  • To control the loading of properties files during application startup.
  • To declare properties that can be conditionally enabled or disabled.
  • To define a condition that must be met for a bean to be registered.
  • To specify which beans should be injected based on the active Spring profiles.
The @ConditionalOnProperty annotation is used in Auto Configuration to define a condition that must be met for a bean to be registered. It allows you to conditionally enable or disable the registration of a bean based on the presence and value of specified properties in the application.properties file.
Add your answer
Loading...

Leave a comment

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