The JsonPSample sample contains a simple web application, jsonp.war, which illustrates use of the Liberty jsonp-1.0 feature. When present, this feature enables the javax.json classes introduced as part of the Java EE 7 specification. These provide Java interfaces and factories for parsing, manipulating, and saving data in JavaScript Object Notation (JSON) form.
It is expected that use of the JsonP API will largely replace use of IBM's JSON4J classes, which were an earlier set of java tools for this purpose... but the two differ enough that it's possible both will remain in use.
Currently supported demonstrations:
And just for fun, toy routines to convert between JSON and JinX (an ad-hoc "JSON in XML" syntax). This demonstrates both tree-walking the JSON model and more complicated programmatic construction.
This sample can be installed onto runtime versions 8.5.5.4 and later.
Online installation (requires 8.5.5.6 or later):
installUtility install JsonPSample
Any missing features required by the server will be installed for you.
Offline installation:
JsonPSample.jar
using the download button at the top of the page and place it in the root of your server installation. java -jar JsonPSample.jar
Any missing features required by the server will need to be installed separately.
To run the jsonp application:
bin
directory in the Liberty profile installation: server run JsonPSample
CWWKZ0001I: Application jsonp started in XX.XX seconds.
JsonP Servlet - Basic demonstration of JSR353 (JSON Processing) support.followed by an introductory page describing the examples and providing links to each of them. To return to this "home page", click the
Return to /jsonp menulink at the bottom of each of these pages.
The jsonp.war
file contains the source and binaries for the application, and can be used to import it to Eclipse.
The application is automatically installed because it is located in the server dropins directory. Any number of applications can be installed from this location.