Java EE 7 SDK 

Samples Main Page

The JAX-RS JSONP Sample Application

This sample demonstrates how to use the Java API for JSON Processing with JAX-RS.

Description

This sample shows a JAX-RS application that produces and consumes JSON using the Java API for JSON Processing. The JAX-RS resources in this sample can use JsonObject, JsonArray, and JsonStructure objects as method parameters and return types.

Key Features

This sample demonstrates the following key features:

Building, Deploying, and Running the Application

Perform the following steps to build, deploy, and run the application:

  1. Set up your build environment and configure the application server with which the build system has to work by following the common build instructions.
  2. app_dir is the sample application base directory: samples_install_dir/jsonp/jaxrs.
  3. Build, deploy, and run the sample application using the run outcome.

    mvn clean verify cargo:run

  4. The resources of the sample application are located at the following URLs: (The port number might vary.)

  5. Use the clean outcome to undeploy the sample application and to remove the temporary directories such as build and dist.

    mvn clean

Troubleshooting

If you have problems when running the application, refer to the troubleshooting document.



Copyright © 1997-2013 Oracle and/or its affiliates. All rights reserved.