Which of the following annotations enables Auto Configuration in a Spring Boot application?
- @ComponentScan
- @Configuration
- @EnableAutoConfiguration
- @SpringBootApplication
The @EnableAutoConfiguration annotation enables Auto Configuration in a Spring Boot application. It triggers the automatic configuration of beans and components based on the project's dependencies and classpath. @SpringBootApplication is a meta-annotation that includes @EnableAutoConfiguration along with other annotations. @Configuration is used to define Java-based Spring configurations, and @ComponentScan is used for component scanning. They are not directly related to enabling Auto Configuration.
Loading...
Related Quiz
- Which Java utility is primarily used for monitoring Java applications and troubleshoot performance issues?
- In Spring Security, how can method security expressions be utilized to implement complex security constraints on service methods?
- To define a global default exception handler for unhandled exceptions in Spring Boot, you can use a _____ with the highest precedence.
- In a Spring Boot application, you are required to develop a feature where the response body should be customized based on the client's preference. How would you implement this feature using Spring Boot annotations?
- What is the primary role of the @RestController annotation in Spring Boot?