cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Geer <ch...@cxtsoftware.com>
Subject Re: Using Response.entity() returns different JSON
Date Wed, 16 May 2012 15:17:53 GMT
Have you tried to use the Jackson provider?

<jaxrs:providers>

            <bean
class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider"/>
          </jaxrs:providers>

It gives you a different serialization format that might be closer to what
you want. You do need to include the Jackson jar in your application since
it doesn't come by default.

Chris

On Wed, May 16, 2012 at 7:30 AM, jsicotte <sicotte.jason@gmail.com> wrote:

> In my code I not returning a User object, that was just an example. If you
> want an example class tough, below is the class for an application error:
>
>       @XmlRootElement
>        public class ErrorResponse {
>            private ErrorCode code;
>            private String summary;
>            private String description;
>
>            public ErrorCode getCode() {return code;}
>            public void setCode(ErrorCode code) {this.code = code;}
>            public String getSummary() {return summary;}
>            public void setSummary(String summary) {this.summary = summary;}
>            public String getDescription() {return description;}
>            public void setDescription(String description)
> {this.description =
> description;}
>      }
>
> As you an see, it is pretty straight forward with simple getters and
> setters.
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Using-Response-entity-returns-different-JSON-tp5707943p5707972.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

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