Recall & Review
beginner
What is auto-configuration in Spring Boot?
Auto-configuration is a feature in Spring Boot that automatically sets up beans and configurations based on the libraries and settings found in the project, reducing the need for manual setup.
Click to reveal answer
intermediate
How does Spring Boot know which auto-configuration classes to apply?
Spring Boot uses the
spring.factories file inside the spring-boot-autoconfigure module to list all auto-configuration classes. It loads these classes conditionally based on the presence of certain classes or properties.Click to reveal answer
intermediate
What role do @Conditional annotations play in auto-configuration?
Annotations like
@ConditionalOnClass or @ConditionalOnProperty tell Spring Boot to apply auto-configuration only if certain classes exist or specific properties are set, making configuration smart and flexible.Click to reveal answer
intermediate
How can you disable a specific auto-configuration in Spring Boot?
You can disable an auto-configuration by using
@SpringBootApplication(exclude = {AutoConfigClass.class}) or by setting spring.autoconfigure.exclude=AutoConfigClass in application.properties.Click to reveal answer
beginner
Why is auto-configuration helpful for beginners?
Auto-configuration saves beginners time by setting up common configurations automatically. It lets them focus on writing business logic instead of boilerplate setup.
Click to reveal answer
What file lists all auto-configuration classes in Spring Boot?
✗ Incorrect
Spring Boot uses the spring.factories file to list auto-configuration classes.
Which annotation is used to apply auto-configuration only if a class is present?
✗ Incorrect
@ConditionalOnClass checks if a class is present before applying configuration.
How can you exclude an auto-configuration class in Spring Boot?
✗ Incorrect
You exclude auto-configuration classes using the exclude attribute in @SpringBootApplication.
Auto-configuration in Spring Boot is mainly designed to:
✗ Incorrect
Auto-configuration sets up beans automatically based on what it finds in the classpath.
Which property can be used to disable auto-configuration in application.properties?
✗ Incorrect
spring.autoconfigure.exclude lists auto-configuration classes to disable.
Explain how Spring Boot decides which auto-configuration classes to apply during startup.
Think about how Spring Boot checks the environment and dependencies before configuring.
You got /4 concepts.
Describe how you can customize or disable auto-configuration in a Spring Boot project.
Consider both code annotations and configuration files.
You got /4 concepts.