org.apache.coyote.Response.getStatus()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(141)

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

Response.getStatus介绍

暂无

代码示例

代码示例来源:origin: line/armeria

private static HttpHeaders convertResponse(Response coyoteRes) {
  final HttpHeaders headers = HttpHeaders.of(HttpStatus.valueOf(coyoteRes.getStatus()));
  final String contentType = coyoteRes.getContentType();
  if (contentType != null && !contentType.isEmpty()) {
    headers.set(HttpHeaderNames.CONTENT_TYPE, contentType);
  }
  final long contentLength = coyoteRes.getBytesWritten(true); // 'true' will trigger flush.
  final String method = coyoteRes.getRequest().method().toString();
  if (!"HEAD".equals(method)) {
    headers.setLong(HttpHeaderNames.CONTENT_LENGTH, contentLength);
  }
  final MimeHeaders cHeaders = coyoteRes.getMimeHeaders();
  final int numHeaders = cHeaders.size();
  for (int i = 0; i < numHeaders; i++) {
    final AsciiString name = toHeaderName(cHeaders.getName(i));
    if (name == null) {
      continue;
    }
    final String value = toHeaderValue(cHeaders.getValue(i));
    if (value == null) {
      continue;
    }
    headers.add(name.toLowerCase(), value);
  }
  return headers;
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Return the HTTP status code associated with this Response.
 */
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: tomcat/catalina

/**
 * Return the HTTP status code associated with this Response.
 */
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Return the HTTP status code associated with this Response.
 */
@Override
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Return the HTTP status code associated with this Response.
 */
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Return the HTTP status code associated with this Response.
 */
@Override
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Return the HTTP status code associated with this Response.
 */
@Override
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Return the HTTP status code associated with this Response.
 */
@Override
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: org.osivia.portal.core/osivia-portal-jbossas-jbossweb-lib

/*      */   public int getStatus()
/*      */   {
/*  904 */     return this.coyoteResponse.getStatus();
/*      */   }
/*      */

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
public int getStatus() {
  return coyoteResponse.getStatus();
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
public int getStatus() {
  return getCoyoteResponse().getStatus();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

private void checkExpectationAndResponseStatus() {
  if (request.hasExpectation() &&
      (response.getStatus() < 200 || response.getStatus() > 299)) {
    // Client sent Expect: 100-continue but received a
    // non-2xx final response. Disable keep-alive (if enabled)
    // to ensure that the connection is closed. Some clients may
    // still send the body, some may send the next request.
    // No way to differentiate, so close the connection to
    // force the client to send the next request.
    inputBuffer.setSwallowInput(false);
    keepAlive = false;
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public int getStatus() {
  return getCoyoteResponse().getStatus();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/** Called by the processor before recycling the request. It'll collect
 * statistic information.
 */
void updateCounters() {
  bytesReceived+=req.getBytesRead();
  bytesSent+=req.getResponse().getContentWritten();
  requestCount++;
  if( req.getResponse().getStatus() >=400 )
    errorCount++;
  long t0=req.getStartTime();
  long t1=System.currentTimeMillis();
  long time=t1-t0;
  this.lastRequestProcessingTime = time;
  processingTime+=time;
  if( maxTime < time ) {
    maxTime=time;
    maxRequestUri=req.requestURI().toString();
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

/** Called by the processor before recycling the request. It'll collect
 * statistic information.
 */
void updateCounters() {
  bytesReceived+=req.getBytesRead();
  bytesSent+=req.getResponse().getContentWritten();
  requestCount++;
  if( req.getResponse().getStatus() >=400 )
    errorCount++;
  long t0=req.getStartTime();
  long t1=System.currentTimeMillis();
  long time=t1-t0;
  this.lastRequestProcessingTime = time;
  processingTime+=time;
  if( maxTime < time ) {
    maxTime=time;
    maxRequestUri=req.requestURI().toString();
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/** Called by the processor before recycling the request. It'll collect
 * statistic information.
 */
void updateCounters() {
  bytesReceived+=req.getBytesRead();
  bytesSent+=req.getResponse().getContentWritten();
  requestCount++;
  if( req.getResponse().getStatus() >=400 )
    errorCount++;
  long t0=req.getStartTime();
  long t1=System.currentTimeMillis();
  long time=t1-t0;
  this.lastRequestProcessingTime = time;
  processingTime+=time;
  if( maxTime < time ) {
    maxTime=time;
    maxRequestUri=req.requestURI().toString();
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

/** Called by the processor before recycling the request. It'll collect
 * statistic information.
 */
void updateCounters() {
  bytesReceived+=req.getBytesRead();
  bytesSent+=req.getResponse().getBytesWritten();
  requestCount++;
  if( req.getResponse().getStatus() >=400 )
    errorCount++;
  long t0=req.getStartTime();
  long t1=System.currentTimeMillis();
  long time=t1-t0;
  this.lastRequestProcessingTime = time;
  processingTime+=time;
  if( maxTime < time ) {
    maxTime=time;
    maxRequestUri=req.requestURI().toString();
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/** Called by the processor before recycling the request. It'll collect
 * statistic information.
 */
void updateCounters() {
  bytesReceived+=req.getBytesRead();
  bytesSent+=req.getResponse().getContentWritten();
  requestCount++;
  if( req.getResponse().getStatus() >=400 )
    errorCount++;
  long t0=req.getStartTime();
  long t1=System.currentTimeMillis();
  long time=t1-t0;
  this.lastRequestProcessingTime = time;
  processingTime+=time;
  if( maxTime < time ) {
    maxTime=time;
    maxRequestUri=req.requestURI().toString();
  }
}

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

/** Called by the processor before recycling the request. It'll collect
 * statistic information.
 */
void updateCounters() {
  bytesReceived+=req.getBytesRead();
  bytesSent+=req.getResponse().getBytesWritten();
  requestCount++;
  if( req.getResponse().getStatus() >=400 )
    errorCount++;
  long t0=req.getStartTime();
  long t1=System.currentTimeMillis();
  long time=t1-t0;
  this.lastRequestProcessingTime = time;
  processingTime+=time;
  if( maxTime < time ) {
    maxTime=time;
    maxRequestUri=req.requestURI().toString();
  }
}

相关文章

微信公众号

最新文章

更多