org.apache.catalina.connector.Response.getCoyoteResponse()方法的使用及代码示例

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

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

Response.getCoyoteResponse介绍

[英]Get the Coyote response.
[中]得到狼的回应。

代码示例

代码示例来源:origin: spring-projects/spring-framework

private static HttpHeaders createTomcatHttpHeaders(HttpServletResponse response) {
  ResponseFacade responseFacade = getResponseFacade(response);
  org.apache.catalina.connector.Response connectorResponse = (org.apache.catalina.connector.Response)
      ReflectionUtils.getField(COYOTE_RESPONSE_FIELD, responseFacade);
  Assert.state(connectorResponse != null, "No Tomcat connector response");
  Response tomcatResponse = connectorResponse.getCoyoteResponse();
  TomcatHeadersAdapter headers = new TomcatHeadersAdapter(tomcatResponse.getMimeHeaders());
  return new HttpHeaders(headers);
}

代码示例来源:origin: org.springframework/spring-web

private static HttpHeaders createTomcatHttpHeaders(HttpServletResponse response) {
  ResponseFacade responseFacade = getResponseFacade(response);
  org.apache.catalina.connector.Response connectorResponse = (org.apache.catalina.connector.Response)
      ReflectionUtils.getField(COYOTE_RESPONSE_FIELD, responseFacade);
  Assert.state(connectorResponse != null, "No Tomcat connector response");
  Response tomcatResponse = connectorResponse.getCoyoteResponse();
  TomcatHeadersAdapter headers = new TomcatHeadersAdapter(tomcatResponse.getMimeHeaders());
  return new HttpHeaders(headers);
}

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

/**
 * @return the content length that was set or calculated for this Response.
 */
public int getContentLength() {
  return getCoyoteResponse().getContentLength();
}

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

/**
 * @return the Locale assigned to this response.
 */
@Override
public Locale getLocale() {
  return getCoyoteResponse().getLocale();
}

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

/**
 * @return the error message that was set with <code>sendError()</code>
 * for this Response.
 */
public String getMessage() {
  return getCoyoteResponse().getMessage();
}

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

/**
 * Set the error flag.
 *
 * @return <code>false</code> if the error flag was already set
 */
public boolean setError() {
  return getCoyoteResponse().setError();
}

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

/**
 * Error flag accessor.
 *
 * @return <code>true</code> if the response has encountered an error
 */
public boolean isError() {
  return getCoyoteResponse().isError();
}

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

/**
 * Has the output of this response already been committed?
 *
 * @return <code>true</code> if the response has been committed
 */
@Override
public boolean isCommitted() {
  return getCoyoteResponse().isCommitted();
}

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

/**
 * @return the Locale assigned to this response.
 */
@Override
public Locale getLocale() {
  return getCoyoteResponse().getLocale();
}

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

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

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

/**
 * @return the content type that was set or calculated for this response,
 * or <code>null</code> if no content type was set.
 */
@Override
public String getContentType() {
  return getCoyoteResponse().getContentType();
}

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

/**
 * @return the error message that was set with <code>sendError()</code>
 * for this Response.
 */
public String getMessage() {
  return getCoyoteResponse().getMessage();
}

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

@Override
public Collection<String> getHeaders(String name) {
  Enumeration<String> enumeration =
      getCoyoteResponse().getMimeHeaders().values(name);
  Vector<String> result = new Vector<>();
  while (enumeration.hasMoreElements()) {
    result.addElement(enumeration.nextElement());
  }
  return result;
}

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

@Override
public void setContentLengthLong(long length) {
  if (isCommitted()) {
    return;
  }
  // Ignore any call from an included servlet
  if (included) {
    return;
  }
  getCoyoteResponse().setContentLength(length);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-web

private static HttpHeaders createTomcatHttpHeaders(HttpServletResponse response) {
  org.apache.catalina.connector.Response connectorResponse = (org.apache.catalina.connector.Response)
      ReflectionUtils.getField(COYOTE_RESPONSE_FIELD, response);
  Assert.state(connectorResponse != null, "No Tomcat connector response");
  Response tomcatResponse = connectorResponse.getCoyoteResponse();
  TomcatHeadersAdapter headers = new TomcatHeadersAdapter(tomcatResponse.getMimeHeaders());
  return new HttpHeaders(headers);
}

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

@Override
public String getHeader(String name) {
  return getCoyoteResponse().getMimeHeaders().getHeader(name);
}

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

@Override
public Collection<String> getHeaderNames() {
  MimeHeaders headers = getCoyoteResponse().getMimeHeaders();
  int n = headers.size();
  List<String> result = new ArrayList<>(n);
  for (int i = 0; i < n; i++) {
    result.add(headers.getName(i).toString());
  }
  return result;
}

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

@Override
public Collection<String> getHeaderNames() {
  MimeHeaders headers = getCoyoteResponse().getMimeHeaders();
  int n = headers.size();
  List<String> result = new ArrayList<>(n);
  for (int i = 0; i < n; i++) {
    result.add(headers.getName(i).toString());
  }
  return result;
}

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

@Override
  public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) {
    long commitTime = response.getCoyoteResponse().getCommitTime();
    if (commitTime == -1) {
      buf.append('-');
    } else {
      long delta = commitTime - request.getCoyoteRequest().getStartTime();
      buf.append(Long.toString(delta));
    }
  }
}

代码示例来源:origin: com.springsource.insight/insight-collection-tcserver

void fillInResponseDetails(OperationMap op, Response response) {
  op.put("statusCode", response.getStatus())
    .put("reasonPhrase", parseReasonPhrase(response))
    .put("contentSize", (Long) ReflectionUtils.invokeMethod(responseSizeMethod, response));
  fillInHeaders(op.createList("headers"), response.getCoyoteResponse().getMimeHeaders());
}

相关文章

Response类方法