WARNING: HTTP GET method, public javax.ws.rs.core.Response ... throws org.codehaus.jettison.json.JSONException, should not consume any object

I have the following GET method and it cannot send the result to the client.

/*@GET here defines, this method will process HTTP GET requests. */ @GET @Path("/test/{name}/{status}") @Produces("application/json") public Response Name(@PathParam("name,status") String name, String status ) throws JSONException { String total = "100"; . . . String result = "" + jsonObject; return Response.status(200).entity(result).build(); } 

When I ran it, I have the following message: WARNING: HTTP GET method, public javax.ws.rs.core.Response ... throws org.codehaus.jettison.json.JSONException, should not consume any object.

Is this because I have two options?

I already checked online, but had nothing to do with my situation. Thanks in advance!

+6
source share
1 answer

I think I found the problem ... it should be like this:

 Name(@PathParam("name") String name, @PathParam("status") String status ) 

Thanks!

+6
source

Source: https://habr.com/ru/post/973583/


All Articles