From the Front-end
I send the file JSON
, then in the Servlet
, through GSON
I transform it into an object:
PrintWriter out = response.getWriter();
String texto = request.getReader().readLine();
Gson gson = new Gson();
json1 = gson.fromJson(texto, Reserva.class);
What I want to do is post the amount of elements that the JSON
file has. Or post the amount of elements that the Java object contains ( json1
).
This is the JSON
:
{
"hot": "1",
"numN": "1",
"tipH": "camasimple ",
"fechl": "2018-05-24",
"num": "1",
"numa": "1"
}
Greetings.