close
Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.MD

JSONB Example

This example demonstrates how to use JSONB with resource classes.

Contents

The mapping of the URI path space is presented in the following table:

URI path Resource class HTTP methods
/jsonb/cats/one JsonbResource GET
/jsonb/cats/all JsonbResource GET
/jsonb/cats/add JsonbResource POST
/jsonb/cats/addAll JsonbResource POST

Running the Example

Run the example as follows:

mvn clean compile exec:java

This deploys the example using Grizzly container. You can access the application at:

or you can post an xml entity:

curl -v -X POST http://localhost:8080/json-binding-webapp/cats/add -H "Content-Type:application/json" -d ' {"color":"white","sort":"maine coon","catName":"Darwin", "domesticated":"true"}'

You can also use the built war file to deploy the app to a container of your choice.