org.glassfish.grizzly.http.server.Response.setDetailMessage()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中org.glassfish.grizzly.http.server.Response.setDetailMessage方法的一些代码示例,展示了Response.setDetailMessage的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.setDetailMessage方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Response
类名称:Response
方法名:setDetailMessage

Response.setDetailMessage介绍

[英]Sets detail error message.
[中]设置详细信息错误消息。

代码示例

代码示例来源:origin: opentripplanner/OpenTripPlanner

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());

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * 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));
}

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * 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);
}

代码示例来源:origin: javaee/grizzly

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: javaee/grizzly

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: javaee/grizzly

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: javaee/grizzly

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: javaee/grizzly

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: javaee/grizzly

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

代码示例来源:origin: javaee/grizzly

} catch (CharConversionException e) {
  response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
  response.setDetailMessage("Invalid URI: " + e.getMessage());
  return true;

相关文章

微信公众号

最新文章

更多

Response类方法