include::../shared-doc/attributes.adoc[]

= jsonp: JSON-P Object-based JSON generation and Stream-based JSON consuming
:author: Rafael Benevides
:level: Beginner
:technologies: CDI, JSF, JSON-P

[abstract]
The `jsonp` quickstart demonstrates how to use the JSON-P API to produce object-based structures and then parse and consume them as stream-based JSON strings.

:standalone-server-type: default
:archiveType: war

//*************************************************
// Shared CD and Product Release content
//*************************************************

== What is it?

The `jsonp` quickstart creates a JSON string through object-based JSON generation and then parses and consumes it using stream-based JSON.

It shows how to use the JSON-P API to generate, parse, and consume JSON files.

//*************************************************
// Product Release content only
//*************************************************

ifndef::EAPCDRelease[]

// System Requirements
include::../shared-doc/system-requirements.adoc[leveloffset=+1]
// Use of {jbossHomeName}
include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1]
// Start the {productName} Standalone Server
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+1]
// Build and Deploy the Quickstart
include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+1]

== Access the Application

Access the running application in a browser at the following URL: http://localhost:8080/{artifactId}/

. You are presented with a simple form that is pre-filled with personal data. You can change those values if you prefer.

. Click on the *Generate JSON String from Personal Data* button. The text area below the button presents a JSON string representing the data and values from the completed form.
+
Note that the JSON string contains String, number, boolean and array values.

. Now, click on the *Parse JSON String using Stream* button. The text area below the button shows the events generated from the parsed JSON string.

// Undeploy the Quickstart
include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1]
// Run the Quickstart in Red Hat Developer Studio or Eclipse
include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1]
// Debug the Application
include::../shared-doc/debug-the-application.adoc[leveloffset=+1]

endif::[]

//*************************************************
// CD Release content only
//*************************************************

ifdef::EAPCDRelease[]

// Getting Started with OpenShift
include::../shared-doc/cd-openshift-getting-started.adoc[leveloffset=+1]
//Prepare OpenShift for Quickstart Deployment
include::../shared-doc/cd-create-project.adoc[leveloffset=+1]
// Import the Latest {xpaasproduct-shortname} Image Streams and Templates
include::../shared-doc/cd-import-imagestreams-templates.adoc[leveloffset=+1]
// Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift
include::../shared-doc/cd-deploy-project.adoc[leveloffset=+1]
// OpenShift Post Deployment Tasks: This is not currently needed.
// include::../shared-doc/cd-post-deployment-tasks.adoc[leveloffset=+1]

endif::[]

