I'm new to Java and have used the long piece of code provided in
GWT: Dealing with incoming JSON string
to read the json similar to the layout of the original posting person raised.
My layout is as follows:
{
"messagedata": [
{
"msgkey": "12552",
"reference": "201708010001",
"bic": "PARABLULLEISI",
"securityid": "BE0003735496",
"safekeepingacc": "7744085P"
},
{
"msgkey": "12553",
"reference": "000081676368",
"bic": "PARABLULLEISX",
"securityid": "CNE00000BQ0",
"safekeepingacc": "1053542760H"
}
]
}
But the final line of code (jsonString.stringValue()) only ever reads the first block of JSON data i.e. msgkey or bic from the first section.
How would i get data from other sections i.e. if there were 3 sections each containing msgkey, bic, reference etc
More importantly if i know the msgkey value as in the sample JSON how can I get the other associated values for that section when the msgkey value changes?
I've used the library com.google.gwt.json.client.*
Thanks Martin