Enterprise Integration Zone is brought to you in partnership with:

Reza Rahman is a former independent consultant, now Java EE/GlassFish evangelist at Oracle. He is the author of the popular book EJB 3 in Action. Reza is a frequent speaker at Java User Groups and conferences worldwide. Reza has been a member of the Java EE, EJB and JMS expert groups. He implemented the EJB container for the Resin open source Java EE application server. All views voiced are my own, not necessarily Oracle's. Reza is a DZone MVB and is not an employee of DZone and has posted 165 posts at DZone. You can read more from them at their website. View Full User Profile

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

11.19.2013
| 4831 views |
  • submit to reddit

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-writtendocumentation.

Published at DZone with permission of Reza Rahman, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)