Carol Carol -4 years ago 85
Java Question

Getting many Objects by JSON - JAXRS

I'm doing a RESTful JSON WS.

I need to recieve as a JSON (by POST) with many Objects.(
e.g

{"name":"carol", "age":"18"},{"name":"carlos", "age":"19"}
)

How can I put this
Array
of
Objects
into my java code?

PS: I hava a Class called
Person
which have the attributes
name
and
age
.

Answer Source

[{"name":"carol", "age":"18"},{"name":"carlos", "age":"19"}]

You have to put array bracket at both end. I hope it works for you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download