Reputation: 351
In java/spring, when you use the @Value annotation to insert values into a field, where exactly does the application look for these values? I have read up and I keep seeing that it looks for a "properties file" but is there a specific name/format this file needs to have, or a certain directory this file needs to be in?
Upvotes: 0
Views: 1657
Reputation: 140
If you don't give any specific path
thn it will use default path :
\src\main\resources\application.properties
You can also give specific path :
@propertySource("file:properties/application.properties")
Here properties folder is on same level of src folder. You can put your property file anywhere.
Hope this will work!
Upvotes: 1