Java EE 8 SDK |
This sample demonstrates how to use the Java API for JSON Binding with JAX-RS.
This sample shows a JAX-RS application that produces and consumes JSON using the Java API for JSON Binding (JSON-B).
This sample demonstrates the following key features:
Perform the following steps to build, deploy, and run the application:
app_dir
is the sample application base directory: samples_install_dir/jsonb/jaxrs
.
run
outcome.
mvn clean verify cargo:run
http://localhost:8080/jsonb-jaxrs-resources/serialization
JsonbProperty
and JsonbNillable
annotationshttp://localhost:8080/jsonb-jaxrs-resources/deserialization
JsonPointer
to get an objecthttp://localhost:8080/jsonb-jaxrs-resources/generic
List<Person>
clean
outcome to undeploy the sample application and to remove the temporary directories
such as build
and dist
.
mvn clean
If you have problems when running the application, refer to the troubleshooting document.
Copyright © 1997-2017 Oracle and/or its affiliates. All rights reserved.