On 13/06/12 20:58, Penmatsa, Vinay wrote:
From documentation in
http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-MessageBodyProviders:
"By default, CXF supports String, byte[], InputStream, Reader, File, JAXP
Source, JAX-RS StreamingOutput, JAXB-annotated types with application/xml, text/xml
and application/json formats as well as JAXBElement (see below). JAX-RS
MultivaluedMap is also supported for form contents.
See also the "Support for data bindings" section below."
I couldn't find a MessageBodyReader/Writer implementation for MultivaluedMap in
CXF. How could I use this type?
org.apache.cxf.jaxrs.provider.FormEncodingProvider manages
MultivaluedMap, it is enabled by default
In general, if I want to use a Map<String,String> in a REST POST, should I
write readers/writers for the Map type or does CXF provide anything by default?
Map<String, String> is not equivalent to MultivaluedMap<String, String>,
the latter is actually Map<String, List<String>>.
So yes, if you need to handle Map<String, String>, then add a provider
for it
Cheers, Sergey
Thanks,
Vinay
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com