In Spring Boot, which annotation is used to bind the properties defined in the application properties file to a POJO?
- @Autowired
- @ConfigurationProperties
- @PropertySource
- @Value
In Spring Boot, the @ConfigurationProperties annotation is used to bind properties defined in the application properties file to a POJO (Plain Old Java Object). This allows you to map properties to fields in your Java class, providing a convenient way to access and manage configuration settings. The other annotations serve different purposes in Spring Boot, but @ConfigurationProperties is specifically designed for property binding.
Loading...
Related Quiz
- What is the role of the @Repository annotation in the context of database interaction and exception translation?
- Which annotation is used to disable full auto-configuration and instead apply only configuration relevant to JPA tests in Spring Boot?
- In unit testing of Spring Boot applications, the _____ method of Assert class is commonly used to check if the specified condition is true.
- In Spring Boot, the _____ annotation is used to conditionally enable a configuration based on the presence of a specific property.
- For custom authentication logic in Spring Security, developers can create a bean of type _____.