I have a Restful service running in Jboss EAP 6.2 + RestEasy 2.3.7 and I am returning 501, 404 error codes using below snippet in my code :
For 404, throw new WebApplicationException(Status.NOT_FOUND); For 500, throw new WebApplicationException();
When I am testing my service for these changes it sends back correct status code but the body has html information like the one shown below for 404.
Please guide me on how to send blank response for these status codes.
Note:
I have tried below code too, bit it is not working.
ResponseBuilder respBldr = Response.status(Status.FORBIDDEN);
respBldr.type(MediaType.TEXT_HTML);
respBldr.entity("");
throw new WebApplicationException(respBldr.build());
Seems to be a bug in EAP 6.2.4. Attaching the link (https://issues.jboss.org/browse/WFLY-1419).