0
In a client-server structure (in JAVA), I have the following Json structures separately (example): Structure of Students:
{"idAluno":1,"nomeAluno":"Teste da Silva","listaDeTurmas":[1,2]}
Structure of Classes:
{"idTurma":1,"nomeTurma":"Redes"}
{"idTurma":2,"nomeTurma":"Compiladores"}
Each structure is managed by a different Java application. Another application requests each of them. After a request to the Students, I receive as a response the structure I referenced above. In the case of a search request, I need to display the data of the class in question in the Class Array. Example:
{
"idAluno": 1,
"nomeAluno": "Teste da Silva",
"listaDeTurmas": [
{
"idTurma": 1,
"nomeTurma": "Redes"
},
{
"idTurma": 2,
"nomeTurma": "Compiladores"
}
]
}
For each class id, I make a request in the Classes application and receive the corresponding structure of the searched class. But what is the correct way to modify the Array in the student’s Json and have the class data displayed instead of simply its code (as the example above)? I need to dismember the two structures and create a new Json from there or there’s a simpler way to do this?
I would pass the
JSONs
for matching objects in the application that is making the request, would organize the list of Class objects inside the Student object, and then reassemble the stringJSON
from the object Student. (only one of the ways of solution) :p– Paulo H. Hartmann
Only that the Class Array of my Student object is an Integer Arraylist. I would have to create another class with String Arraylist from there?
– André Raubach