Java Reference
In-Depth Information
public Response bookPlace(@PathParam("id") int id) {
try {
} catch (Exception e) {
final Entity<String> errorMessage = Entity
If you have understood our earlier section well, this code will be almost intuitive to you.
We have included two methods here, just like the SOAP alter ego; the former one is
named getSeatList , which is bound to an HTTP GET request and produces the list of
Seats . The list is returned using a JSON representation that is pretty common when re-
turning Java objects to the client.
The grammar for JSON objects is simple and requires the grouping of the data definition
and data values; it is as follows:
• Elements are enclosed within curly brackets ( { and } )
• Values of elements come in pairs with the structure of name:value and are
comma separated
• Arrays are enclosed within square brackets ( [ and ] )
That's all there is to it (for the full JSON grammar description, visit ) .
Search WWH ::

Custom Search