2
I have a service like this:
@Path("/test")
public class TestEndPoint {
@GET
@Produces("application/json")
public Response get(){
POJO pojo = new POJO();
pojo.setName("Rafael");
return Response.ok(pojo).build();
}
}
and works perfectly
but with Jsonobject, it doesn’t work
@Path("/test")
public class TestEndPoint {
@GET
@Produces("application/json")
public Response get(){
org.json.JSONObject json = new org.json.JSONObject();
json.put("name", "Rafael");
return Response.ok(json).build();
}
}
I use the Jbossas 7.1 with Jackson Provider.
ps - I have a web service with JERSEY and it works perfectly with Jsonobject, but not with RESTEASY. I need to do it. toString so he can generate the answer without exception.
Can you translate your question? Here is the OS in English.
– user28595
Putz, I swear I was asking in . com, I will correct
– user155542
By the way, the negative vote was not me, so much that I commented here to warn you.
– user28595
No problem, it’s part of it. It was my fault.
– user155542
What exception does it give? You will probably need a preview for this type of object.
– Bruno César