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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *