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

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

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

Request.setRequest介绍

[英]Set a wrapped HttpServletRequest to pass to the application. Components wishing to wrap the request should obtain the request via #getRequest(), wrap it and then call this method with the wrapped request.
[中]将包装好的HttpServletRequest设置为传递给应用程序。希望包装请求的组件应该通过#getRequest()获取请求,包装它,然后用包装的请求调用此方法。

代码示例

代码示例来源:origin: stackoverflow.com

//Define a lock object somewhere. Each thread must have access to this somehow.
private final Lock lock = new ReentrantLock();

public void run() {
  boolean inBase = true;
  //This thread is about to use and modify the world.
  //Wait for other threads to finish and occuppy the world by locking.
  lock.lock();
  while (inBase) {
    for (int cityID = 0; cityID < world.getCities().size() && inBase; cityID++) {
      City city = world.getCities().get(cityID);
      if (!city.getRequestsList().isEmpty()) {
        for (int requestID = 0; requestID < city.getRequestsList().size(); requestID++) {
          Request request = city.getRequestsList().get(requestID);
          if (request.isRequest()) {
            request.setRequest(false);
            System.out.println(Thread.currentThread().getName() + " is flying to " + city.getName());
            inBase = false;
            break;
          }
        }
      }
    }
  }
  //This thread is finished with modifying the world.
  //Release the lock so other threads can use it.
  lock.unlock();
  //Do stuff that planes do while flying.
}

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

private void secureResponseJspic(Request request, Response response, JaspicState state) {
  try {
    state.serverAuthContext.secureResponse(state.messageInfo, null);
    request.setRequest((HttpServletRequest) state.messageInfo.getRequestMessage());
    response.setResponse((HttpServletResponse) state.messageInfo.getResponseMessage());
  } catch (AuthException e) {
    log.warn(sm.getString("authenticator.jaspicSecureResponseFail"), e);
  }
}

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

private void secureResponseJspic(Request request, Response response, JaspicState state) {
  try {
    state.serverAuthContext.secureResponse(state.messageInfo, null);
    request.setRequest((HttpServletRequest) state.messageInfo.getRequestMessage());
    response.setResponse((HttpServletResponse) state.messageInfo.getResponseMessage());
  } catch (AuthException e) {
    log.warn(sm.getString("authenticator.jaspicSecureResponseFail"), e);
  }
}

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

request.setRequest((HttpServletRequest) state.messageInfo.getRequestMessage());
response.setResponse((HttpServletResponse) state.messageInfo.getResponseMessage());

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

request.setRequest((HttpServletRequest) state.messageInfo.getRequestMessage());
response.setResponse((HttpServletResponse) state.messageInfo.getResponseMessage());

相关文章

Request类方法