How to enable JSON response in WebEngine ?

Hello,

I would like to return JSON response from WebEngine with something like :

@Produces("application/json")
@GET
@Path("/json")
public Customer getCustomer(@PathParam("customerId") String id) {
  return new Customer("John", "Doe");
}

This throws a :

2012-09-24 10:27:17,848 ERROR [com.sun.jersey.spi.container.ContainerResponse] A message body writer for Java type, class org.mycompany.Customer, and MIME media type, application/json, was not found.

How can I define such body writer ? Nuxeo5.5 includes the Jackson JSON library that fits this need. Is it integrated in WebEngine ? Thanks,

0 votes

0 answers

1390 views

ANSWER