How to reuse Jersey’s JSON/JAXB for serialization?

Jersey uses a couple different frameworks depending on whether you use mapped(), badgerfish(), or natural() notation. Natural is usually the one people want. And that’s implemented using the very good (and very fast) standalone Jackson JSON processor, I believe, which goes from Object->JAXB->JSON. However Jackson also provides it’s own JAX-RS provider to go direct Object->JSON.

In fact, they even added support for JAXB annotations. Have a look at

http://wiki.fasterxml.com/JacksonJAXBAnnotations

I think that’s ultimately what you are looking for. Jackson does Object<->JSON processing…Jersey just makes the calls for you

Leave a Comment