Beppe C
Beppe C

Reputation: 13933

Spring Boot load properties as java.util.Properties

In Spring Boot it is pretty straightforward to read properties from the application.properties (@Value), but what I would like to do is to load all properties in a java.util.Properties object.

Is this possible?

Upvotes: 2

Views: 2081

Answers (1)

YONGSOO KIM
YONGSOO KIM

Reputation: 1300

I think it's possible. You can see how it can be done from here(Click). . And Before doing it, please consider:

  1. Where to put property file?(Same directory as Springboot property file exists?)
  2. For what purpose do you need to use "Property" over "@Value"?
  3. Will other people can read easily with code used "Property"?

Please consider to use "Spring cloud conf" if this seems to be useful for you.

Upvotes: 1

Related Questions