Jersey/JAX-RS: Return a Map as XML/JSON
问题 It's not so obvious how to return a Map as an XML/JSON document using the Jersey/JAX-RS framework. It already has support for List s, but when it comes to Map s, there is no MessageBodyWriter . And even if I were to embed the Ma into a wrapper class, there is no map type in XML schema. Any practical advice on how to marshal a Map into an XML/JSON document in Jersey? 回答1: I know its very late to reply, but I'm hoping it will help somebody someday :) The easiest and quickest fix I applied is