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

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

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

Response.getRequest介绍

[英]Return the Request with which this Response is associated.
[中]返回与此响应关联的请求。

代码示例

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

/**
 * Flush bytes or chars contained in the buffer.
 * 
 * @throws IOException An underlying IOException occurred
 */
public void flush()
  throws IOException {
  if (response.getRequest().getUpgradeHandler() != null) {
    return;
  }
  doFlush(true);
}

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

public void setWriteListener(WriteListener writeListener) {
  if (writeHandler != null) {
    throw new IllegalStateException(rb.getString(LogFacade.WRITE_LISTENER_BEEN_SET));
  }
  Request req = (Request)response.getRequest();
  if (!(req.isAsyncStarted() || req.isUpgrade())) {
    throw new IllegalStateException(rb.getString(LogFacade.NON_ASYNC_UPGRADE_WRITER_EXCEPTION));
  }
  writeHandler = new WriteHandlerImpl(writeListener);
  if (isReady()) {
    try {
      writeHandler.onWritePossible();
    } catch(Throwable t) {
      log.log(Level.WARNING, LogFacade.WRITE_LISTENER_ON_WRITE_POSSIBLE_ERROR, t);
    }
  }
}

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

public void setWriteListener(WriteListener writeListener) {
  if (this.writeListener != null) {
    throw MESSAGES.writeListenerAlreadySet();
  }
  if (writeListener == null) {
    throw MESSAGES.nullListener();
  }
  if (!response.getRequest().isEventMode()) {
    throw MESSAGES.cannotSetListenerWithoutUpgradeOrAsync();
  }
  this.writeListener = writeListener;
  coyoteResponse.action(ActionCode.ACTION_EVENT_WRITE_BEGIN,
      (response.getRequest().getUpgradeHandler() != null) ? writeListener : null);
}

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

/*      */   public void sendError(int status, String message)
/*      */     throws IOException
/*      */   {
/* 1188 */     if (isCommitted()) {
/* 1189 */       throw new IllegalStateException(sm.getString("coyoteResponse.sendError.ise"));
/*      */     }
/*      */ 
/* 1193 */     if (this.included) {
/* 1194 */       return;
/*      */     }
/* 1196 */     Wrapper wrapper = getRequest().getWrapper();
/* 1197 */     if (wrapper != null) {
/* 1198 */       wrapper.incrementErrorCount();
/*      */     }
/*      */ 
/* 1201 */     setError();
/*      */ 
/* 1203 */     this.coyoteResponse.setStatus(status);
/* 1204 */     this.coyoteResponse.setMessage(message);
/*      */ 
/* 1207 */     resetBuffer();
/*      */ 
/* 1210 */     setSuspended(true);
/*      */   }
/*      */

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

/**
 * 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
      (sm.getString("coyoteResponse.sendError.ise"));
  // Ignore any call from an included servlet
  if (included)
    return; 
  Wrapper wrapper = getRequest().getWrapper();
  if (wrapper != null) {
    wrapper.incrementErrorCount();
  } 
  setError();
  coyoteResponse.setStatus(status);
  coyoteResponse.setMessage(message);
  // Clear any data content that has been buffered
  resetBuffer();
  // Cause the response to be finished (from the application perspective)
  setSuspended(true);
}

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

Wrapper wrapper = getRequest().getWrapper();
if (wrapper != null) {
  wrapper.incrementErrorCount();

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

return; 
Wrapper wrapper = getRequest().getWrapper();
if (wrapper != null) {
  wrapper.incrementErrorCount();

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

/**
 * 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
      (sm.getString("coyoteResponse.sendError.ise"));
  // Ignore any call from an included servlet
  if (included)
    return; 
  Wrapper wrapper = getRequest().getWrapper();
  if (wrapper != null) {
    wrapper.incrementErrorCount();
  } 
  setError();
  coyoteResponse.setStatus(status);
  coyoteResponse.setMessage(message);
  // Clear any data content that has been buffered
  resetBuffer();
  // Cause the response to be finished (from the application perspective)
  setSuspended(true);
}

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

return; 
Wrapper wrapper = getRequest().getWrapper();
if (wrapper != null) {
  wrapper.incrementErrorCount();

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

return; 
Wrapper wrapper = getRequest().getWrapper();
if (wrapper != null) {
  wrapper.incrementErrorCount();

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

Wrapper wrapper = getRequest().getWrapper();
if (wrapper != null) {
  wrapper.incrementErrorCount();

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

Wrapper wrapper = getRequest().getWrapper();
if (wrapper != null) {
  wrapper.incrementErrorCount();

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

private void writeBytes(byte b[], int off, int len) 
  throws IOException {
  if (closed)
    return;
  if (response.getRequest().getUpgradeHandler() != null) {
    // If we really have something to write
    if (len > 0) {
      // real write to the adapter
      ByteChunk output = new ByteChunk();
      output.setBytes(b, off, len);
      try {
        coyoteResponse.doWrite(output);
      } catch (IOException e) {
        // An IOException on a write is almost always due to
        // the remote client aborting the request.  Wrap this
        // so that it can be handled better by the error dispatcher.
        throw new ClientAbortException(e);
      }
    }
  } else {
    bb.append(b, off, len);
    bytesWritten += len;
    // if called from within flush(), then immediately flush
    // remaining bytes
    if (doFlush) {
      bb.flushBuffer();
    }
  }
}

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

private void addSessionCookies() throws IOException {
  Request req = (Request) response.getRequest();
  if (req.isRequestedSessionIdFromURL()) {
    return;
  }
  StandardContext ctx = (StandardContext) response.getContext();
  if (ctx == null || !ctx.getCookies()) {
    // cookies disabled
    return;
  }
  Session sess = req.getSessionInternal(false);
  if (sess != null) {
    addSessionVersionCookie(req, ctx);
    addSessionCookieWithJvmRoute(req, ctx, sess);
    addSessionCookieWithJReplica(req, ctx, sess);
    addPersistedSessionCookie(req, ctx, sess);
    addJrouteCookie(req, ctx, sess);
    addSsoVersionCookie(req, ctx);
  }
}

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

/**
 * 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 MESSAGES.cannotSendError();
  // Ignore any call from an included servlet
  if (included)
    return; 
  Wrapper wrapper = getRequest().getWrapper();
  if (wrapper != null) {
    wrapper.incrementErrorCount();
  } 
  setError();
  coyoteResponse.setStatus(status);
  coyoteResponse.setMessage(message);
  // Clear any data content that has been buffered
  resetBuffer();
  // Cause the response to be finished (from the application perspective)
  setSuspended(true);
}

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

String locationUri;
if (getRequest().getCoyoteRequest().getSupportsRelativeRedirects() &&
    getContext().getUseRelativeRedirects()) {
  locationUri = location;

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

String locationUri;
if (getRequest().getCoyoteRequest().getSupportsRelativeRedirects() &&
    getContext().getUseRelativeRedirects()) {
  locationUri = location;

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

return;
Request request = response.getRequest();
if (request.getUpgradeHandler() != null && request.isEventMode()) {
  request.getEvent().close();

相关文章

Response类方法