response.setDetailMessage("path should have at least one part"); response.setDetailMessage("no job IDs were found"); if (task.jobId != exemplar.jobId || task.graphId != exemplar.graphId) { response.setStatus(HttpStatus.BAD_REQUEST_400); response.setDetailMessage( "All tasks must be for the same graph and job."); } else { response.setStatus(HttpStatus.NOT_FOUND_404); response.setDetailMessage( "Context not found; should be either 'jobs' or 'priority'"); if (broker.deleteJob(pathComponents[2])) { response.setStatus(HttpStatus.OK_200); response.setDetailMessage("job deleted"); response.setDetailMessage("job not found"); response.setDetailMessage("Delete is only allowed for tasks and jobs."); response.setDetailMessage("Unrecognized HTTP method."); response.setDetailMessage("Could not decode/encode JSON payload. " + jpex.getMessage()); LOG.info("Error processing JSON from client", jpex); } catch (Exception ex) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage(ex.toString());
/** * Set the HTTP status and message to be returned with this response. * * @param status The new HTTP status * @param message The associated text message * * @deprecated As of Version 2.1 of the Java Servlet API, this method * has been deprecated due to the ambiguous meaning of the message * parameter. */ public void setStatus(int status, String message) { if (isCommitted()) return; // Ignore any call from an included servlet if (included) return; coyoteResponse.setStatus(status); // use encoding in GlassFish coyoteResponse.getResponse().setHtmlEncodingCustomReasonPhrase(false); coyoteResponse.setDetailMessage(HtmlEntityEncoder.encodeXSS(message)); }
/** * Send an error response with the specified status and message. * * @param status HTTP status code to send * @param message Corresponding message to send * * @exception IllegalStateException if this response has * already been committed * @exception IOException if an input/output error occurs */ public void sendError(int status, String message) throws IOException { if (isCommitted()) throw new IllegalStateException(rb.getString(LogFacade.CANNOT_CALL_SEND_ERROR_EXCEPTION)); // Ignore any call from an included servlet if (included) { return; } setError(); coyoteResponse.setStatus(status); // use encoding in GlassFish coyoteResponse.getResponse().setHtmlEncodingCustomReasonPhrase(false); coyoteResponse.setDetailMessage(HtmlEntityEncoder.encodeXSS(message)); // Clear any data content that has been buffered resetBuffer(); // Cause the response to be finished (from the application perspective) setSuspended(true); }
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;
} catch (CharConversionException e) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500); response.setDetailMessage("Invalid URI: " + e.getMessage()); return true;