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

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

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

Response.sendAcknowledgement介绍

[英]Send an acknowledgment of a request. An acknowledgment in this case is simply an HTTP response status line, i.e. HTTP/1.1 [STATUS] [REASON-PHRASE][[$0$]]
[中]

代码示例

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

@Override
public void acknowledge() throws IOException {
  if (isAcknowledged) {
    throw new IllegalStateException("Already acknowledged");
  }
  
  isAcknowledged = true;
  response.setStatus(HttpStatus.CONINTUE_100);
  response.sendAcknowledgement();
}

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

@Override
public void acknowledge() throws IOException {
  if (isAcknowledged) {
    throw new IllegalStateException("Already acknowledged");
  }
  
  isAcknowledged = true;
  response.setStatus(HttpStatus.CONINTUE_100);
  response.sendAcknowledgement();
}

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

@Override
public void acknowledge() throws IOException {
  if (isAcknowledged) {
    throw new IllegalStateException("Already acknowledged");
  }
  
  isAcknowledged = true;
  response.setStatus(HttpStatus.CONINTUE_100);
  response.sendAcknowledgement();
}

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

@Override
public void acknowledge() throws IOException {
  if (isAcknowledged) {
    throw new IllegalStateException("Already acknowledged");
  }
  
  isAcknowledged = true;
  response.setStatus(HttpStatus.CONINTUE_100);
  response.sendAcknowledgement();
}

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

@Override
public void acknowledge() throws IOException {
  if (isAcknowledged) {
    throw new IllegalStateException("Already acknowledged");
  }
  
  isAcknowledged = true;
  response.setStatus(HttpStatus.CONINTUE_100);
  response.sendAcknowledgement();
}

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

@Override
public void acknowledge() throws IOException {
  if (isAcknowledged) {
    throw new IllegalStateException("Already acknowledged");
  }
  
  isAcknowledged = true;
  response.setStatus(HttpStatus.CONINTUE_100);
  response.sendAcknowledgement();
}

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

/**
 * Send an acknowledgment of a request.
 * 
 * @exception IOException if an input/output error occurs
 */
public void sendAcknowledgement()
  throws IOException {
  if (isCommitted())
    return;
  // Ignore any call from an included servlet
  if (included)
    return; 
  coyoteResponse.sendAcknowledgement();
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

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

/**
 * The default implementation will acknowledge an <code>Expect: 100-Continue</code>
 * with a response line with the status 100 followed by the final response
 * to this request.
 *
 * @param request the {@link Request}.
 * @param response the {@link Response}.
 *
 * @return <code>true</code> if request processing should continue after
 *  acknowledgment of the expectation, otherwise return <code>false</code>.
 *
 * @throws IOException if an error occurs sending the acknowledgment.
 */
protected boolean sendAcknowledgment(final Request request,
    final Response response)
    throws IOException {
  if ("100-continue".equalsIgnoreCase(request.getHeader(Header.Expect))) {
    response.setStatus(HttpStatus.CONINTUE_100);
    response.sendAcknowledgement();
    return true;
  } else {
    response.setStatus(HttpStatus.EXPECTATION_FAILED_417);
    return false;
  }
}

相关文章

微信公众号

最新文章

更多

Response类方法