Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jackson & Jettison usage in Jersey

Jersey framework uses both Jackson and Jettison libraries for JSON unmarshalling/marshalling. AFAIK, Jettison is for for mapping JSON to XML (with different mechanism support like mapped notation) and Jackson is for JSON generation/parsing (I'm using this without Jersey also).

Will Jersey using these two for two different functionalities or both for same JSON generation/parsing functionality?

I only want support JSON format. At my first thought, it seems I can remove either of the dependencies and I think I can remove Jettison as Jacksone seems more natural choice for JSON generation/parsing.

like image 733
manikanta Avatar asked Aug 30 '11 18:08

manikanta


2 Answers

Jersey will use one or the other, not both, for all JSON processing. Recommendation as far as I know is to use Jackson; Jettison support is older and was implemented before Jackson became available. Jettison is still supported for compatibility reasons but unless some code relies on exact structure it produces (which differs from straight-forward mapping) there's little benefit from using it.

like image 94
StaxMan Avatar answered Nov 15 '22 13:11

StaxMan


I agree, use Jackson or even GSON from google. Jettison has too much limitations and the performance is also lower.

like image 28
Rafa Avatar answered Nov 15 '22 12:11

Rafa