Using properties in Spring with @Value annotation
In this tutorial, I would like to introduce to you all how to use properties in Spring with @Value annotation. First of all, we need a Maven project for example: I will use Java 17 for this example:
1 2 3 4 |
<properties> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> </properties> |
Spring framework dependency:
1 2 3 4 5 |
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>6.0.3</version> </dependency> |
HelloWorld class:… Read More