Posts

Showing posts with the label httpresponse

httpservelet response not returning sendError status code

httpservelet response not returning sendError status code I am trying to determine why a webserver response that initially throws an exception in processing; then returns a 200 OK client side. The details are as follows: a request is sent to the webserver from the web application and if an error occurs an exception is caught and the relevant code &/or message is returned as follows: public void dispatchRequest(HttpServletRequest req, HttpServletResponse res) { if (method.equalsIgnoreCase("get")) { doGet(req, res); } else { res.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED); return; } } void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, HTTPServerException { handleGetClient(request, response); } @SuppressWarnings("unchecked") private void handleGetClient(HttpServletRequest request, HttpServletResponse response) throws IOException, HTTPServerException { ... } ...