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

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

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

Request.getReader介绍

[英]Read the Reader wrapping the input stream for this Request. The default implementation wraps a BufferedReader around the servlet input stream returned by createInputStream().
[中]读取为该请求包装输入流的读取器。默认实现将BufferedReader包装在createInputStream()返回的servlet输入流周围。

代码示例

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(rb.getString(LogFacade.CANNOT_USE_REQUEST_OBJECT_OUTSIDE_SCOPE_EXCEPTION));
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw MESSAGES.nullRequestFacade();
  }
  return request.getReader();
}

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

@Override
public BufferedReader getReader() throws IOException {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getReader();
}

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

public BufferedReader getReader() throws IOException {
  if (super.getCharacterEncoding() == null) {
    setRequestEncodingFromSunWebXml();
  }
  return super.getReader();
}

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

private ByteArrayOutputStream readIncomingPayload() {
  try {
    LOGGER.finest(ProxyCodes.READ_INCOMING_PAYLOAD, "Starting reading payload incoming request URI {0}", getIn().getRequestUri());
    final ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
    try {
      final ServletInputStream sis = request.getInputStream();
      copy(baos, sis);
      baos.flush();
    } catch (final IllegalStateException ise) {
      final ReaderInputStream ris = new ReaderInputStream(request.getReader());
      copy(baos, ris);
      baos.flush();
    }
    if (LOGGER.isLoggable(Level.FINEST)) {
      LOGGER.finest(ProxyCodes.PAYLOAD_INCOMING_REQUEST, "Payload for incoming request URI {0} is {1}",
          getIn().getRequestUri(), new String(baos.toByteArray(), StandardCharsets.UTF_8));
    }
    return baos;
  } catch (final IOException e) {
    LOGGER.severe(ProxyCodes.CANNOT_READ_INCOMING_PAYLOAD, "Can not read incoming payload for request URI {0}", e, getIn().getRequestUri());
  }
  return null;
}

相关文章

Request类方法