Why do I get static text/html when returning a 404 Response with Java / Jersey?
问题 I'm working with Java, Jetty and Jersey 2.18 (latest for now) hosted on a Google App Engine. Let say I have a service such that @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{userId}") public Response getUser(@PathParam("userId") String userId) { ... } When I do: return Response.ok() .entity(user) .build(); I correctly receive an application/json content-type and body. But when I do: return Response .status(404) .entity(new ResponseModel(100, "user not found")) .build(); same as for