-2

Below I have represented my array of object in a my JAVA properties file

arrNew = [{"arrA": [{"type": "abc","id": "xyz","url": [{"name": "A","value": "http://a.com"},{"name": "B","value": "http://b.com"}]}]}]

How should I access the above values in the code ? Also, is there a better way to represent the above structure

talex
  • 17,973
  • 3
  • 29
  • 66
MOFD
  • 253
  • 1
  • 3
  • 8

1 Answers1

0

You can use @Value annotation.

Just declare field in one of your bean like this:

@Value("${arrNew}")
private String value;

Spring will read it for you (of course your property should be in proper property file, for example application.properties).

talex
  • 17,973
  • 3
  • 29
  • 66