Friday Nov 15, 2013

MOXy is the New Default JSON-Binding Provider in GlassFish 4

When I talk about JAX-RS 2, JSON-P and Java EE 7 a surprising number of people seem to assume that GlassFish and Jersey does not support JSON binding and just supports lower level JSON processing. It is in fact correct that Java EE 7 has standardized JSON processing (via JSON-P) but not a JSON binding API yet (although such a standardized API is a very strong consideration for Java EE 8 and would build upon the JSON-P work). However Jersey, the popular JAX-RS reference implementation, has long had strong support for JSON binding via MOXy, Jackson and Jettison (now it also has support for JSON-P of course). In fact, in GlassFish/Jersey the default JSON binding provider is MOXy. If you are not familiar with MOXy, it is a very interesting project part of EclipseLink (the JPA reference implementation) that translates JAXB annotations to JSON. In a code driven post, Blaise Doughan of the Oracle EclipseLink team explains the details of using MOXy with JAX-RS in GlassFish.

For more details on Jersey's support for JSON, you should check out the very well-written documentation.

Thursday Aug 08, 2013

An Overview of JSON-P

JSON is quickly becoming the de facto data interchange format on the web, especially with powerful JavaScript clients, Ajax, REST and HTML 5 WebSockets. This is why JSON-P (or more formally the Java API for JSON Processing) is such a key part of the Java EE 7 release. It is intended to provide a standard, vendor-neutral, ubiquitous solution for parsing, generating and querying JSON. In a brief OTN article, JSON-P specification lead Jitendra Kotamraju (or Jitu as he prefers to be called) overviews JSON-P. He discusses the basics of JSON, JSON-P, the DOM-like Object Model API and the StAX-like Streaming API. There's also the 20-minute JSON-P presentation on the GlassFish videos YouTube channel and my own slide deck below:

You can also check out the very well written JSON-P section of the official Java EE 7 Tutorial or try things out with the newly released Java EE 7 SDK.