How can you access a defined property in the application properties file within a Spring Boot application class?

  • By using the @Value annotation.
  • By modifying the property file directly.
  • By creating a custom annotation.
  • By defining a new property in the code.
In Spring Boot, you can access a defined property in the application properties file within a Spring Boot application class by using the @Value annotation. This annotation allows you to inject property values directly into your beans, making it easy to access and use configuration properties within your code. The other options are not standard ways to access properties in Spring Boot.
Add your answer
Loading...

Leave a comment

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