tree: 810a5bf5e08bb81b1e8942e0ddaa95d982bace65 [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.MD
examples/json-binding-webapp/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 pathResource classHTTP methods
/jsonb/cats/oneJsonbResourceGET
/jsonb/cats/allJsonbResourceGET
/jsonb/cats/addJsonbResourcePOST
/jsonb/cats/addAllJsonbResourcePOST

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.