2v0-7222 Exam QuestionsBrowse all questions from this exam

2v0-7222 Exam - Question 40


Refer to the exhibit.

Which two statements are correct regarding the HelloAutoConfig auto-configuration class when it is specified in the META-INF/spring.factories file? (Choose two.)

Show Answer
Correct Answer: BD

A HelloService bean will be created from the helloService() method only when there is no other HelloService bean in the ApplicationContext. This is indicated by the @ConditionalOnMissingBean annotation. This auto-configuration class is used only when the HelloService.class is on the classpath. This is indicated by the @ConditionalOnClass annotation.

Discussion

2 comments
Sign in to comment
Azuni
Aug 14, 2023

The answers are correct. Refer to: 1) https://docs.spring.io/spring-boot/docs/1.2.5.RELEASE/reference/html/boot-features-developing-auto-configuration.html#boot-features-class-conditions 2) https://docs.spring.io/spring-boot/docs/1.2.5.RELEASE/reference/html/boot-features-developing-auto-configuration.html#boot-features-bean-conditions

2211094Options: BC
Jul 5, 2024

Correct is BC