cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Titus <ati...@fwdco.com>
Subject Re: Marshalling of Strings in JSON
Date Fri, 28 Nov 2014 21:36:37 GMT
Yes, this is correct. Incoming REST parameters when simple strings should
be specified with the URL for get requestss and with a post they can be
form encoded. If you don't want to form encode but instead send a json
object then change the method so it takes a single object as its parameter,
and that object class has the parameters you want.  This is the simplest
way to do it and will save Sergey some work ;-)


On Fri, Nov 28, 2014 at 10:34 AM, Benson Margulies <benson@basistech.com>
wrote:

> Then you'd need your parameter to be, say, Map<String, Object>, or
> some class, not a plain string.
>
> On Fri, Nov 28, 2014 at 10:18 AM, Aaron Titus <atitus@fwdco.com> wrote:
> > curly braces are object syntax.  If you are using JAXB deserializer, it
> > needs an object to create, and therefore you'll have curly braces in the
> > json. The object can have properties that are primitives like boolean or
> > plain String objects and it works just fine for me but as I have stated
> > before I'm using JAXB annotations so this may have something to do with
> it.
> > I have not tried it with a pure Jackson mapper and JSON-only annotations.
> >
> >
> > On Fri, Nov 28, 2014 at 9:49 AM, Benson Margulies <benson@basistech.com>
> > wrote:
> >
> >> Of course it won't work with brackets. That is not the json syntax for a
> >> plain string.
> >> On Nov 28, 2014 9:47 AM, "Aaron Titus" <atitus@fwdco.com> wrote:
> >>
> >> > I think the key is that I am using the JAXB annotations, and not the
> >> JAX-RS
> >> > ones. I am using jackson 2.2.3 now, but it was working also before
> with
> >> > 1.9.   You include the databind jar, and then the JAXB serializer can
> use
> >> > the Jackson Provider.  Specifically I'm using this one:
> >> >
> >> > com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
> >> >
> >> >
> >> >
> >>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message