The _____ annotation in Spring Boot is used to designate a specific bean to be autowired when there are multiple candidates.
- @AutowireBean
- @Autowired
- @Primary
- @Qualifier
In Spring Boot, the "@Primary" annotation is used to designate a specific bean as the primary candidate for autowiring when there are multiple candidates for the same type. This is particularly useful when you have multiple beans of the same type, and you want to specify which one should be injected by default. The other options are related to autowiring but do not serve this specific purpose.
Loading...
Related Quiz
- To authorize access to method-level security in Spring Security, the _______ annotation can be used.
- When creating a custom error response in Spring Boot, the _____ method of the ResponseEntity class can be used to set the HTTP status code of the response.
- When testing with @WebMvcTest, what considerations should be made regarding the security configurations of the application?
- How can you configure profiles in Spring Boot to optimize configuration loading during testing?
- How does Spring Security handle password encoding by default?