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

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

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

Request.setRequestedSessionId介绍

[英]Set the requested session ID for this request. This is normally called by the HTTP Connector, when it parses the request headers.
[中]为此请求设置请求的会话ID。这通常由HTTP连接器在解析请求头时调用。

代码示例

代码示例来源:origin: org.glassfish.main.security/websecurity

public void setRequestedSessionId(String id) {
  httpRequest.setRequestedSessionId(id);
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat7-clustering-wadi

public String replaceRoutingInfoInRequestedSessionId(Request request) {
  String requestedSessionId = request.getRequestedSessionId();
  if (null != requestedSessionId && !requestedSessionId.endsWith("." + nodeName)) {
    int index = requestedSessionId.indexOf(".");
    if (0 < index) {
      String newRequestedSessionId = requestedSessionId.substring(0, index + 1);
      newRequestedSessionId += nodeName;
      request.setRequestedSessionId(newRequestedSessionId);
    }
  }
  return requestedSessionId;
}

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

/**
 * Take the session id from Grizzly Request
 */
protected void obtainSessionId() {
  setRequestedSessionURL(true);
  setJrouteId(coyoteRequest.getJrouteId());
  setRequestedSessionId(coyoteRequest.getRequestedSessionId());
}

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

int semicolon2 = uriBC.indexOf(';', sessionIdStart);
if (semicolon2 >= 0) {
  request.setRequestedSessionId
    (new String(uriBC.getBuffer(), start + sessionIdStart, 
        semicolon2 - sessionIdStart));
  request.setRequestedSessionId
    (new String(uriBC.getBuffer(), start + sessionIdStart, 
        (end - start) - sessionIdStart));
request.setRequestedSessionId(null);
request.setRequestedSessionURL(false);

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    // TODO Is there a better way to map SSL sessions to our sesison ID?
    // TODO The request.getAttribute() will cause a number of other SSL
    //      attribute to be populated. Is this a performance concern?
    request.setRequestedSessionId(
        request.getAttribute(SSLSupport.SESSION_ID_KEY).toString());
    request.setRequestedSessionSSL(true);
  }
}

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

int semicolon2 = uriBC.indexOf(';', sessionIdStart);
if (semicolon2 >= 0) {
  request.setRequestedSessionId
    (new String(uriBC.getBuffer(), start + sessionIdStart, 
        semicolon2 - sessionIdStart));
  request.setRequestedSessionId
    (new String(uriBC.getBuffer(), start + sessionIdStart, 
        (end - start) - sessionIdStart));
request.setRequestedSessionId(null);
request.setRequestedSessionURL(false);

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    // TODO Is there a better way to map SSL sessions to our sesison ID?
    // TODO The request.getAttribute() will cause a number of other SSL
    //      attribute to be populated. Is this a performance concern?
    request.setRequestedSessionId(
        request.getAttribute(SSLSupport.SESSION_ID_KEY).toString());
    request.setRequestedSessionSSL(true);
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat7-clustering-wadi

protected void invokeLocally() throws ClusteredInvocationException {
  String oldRequestedSessionId = router.replaceRoutingInfoInRequestedSessionId(request);
  try {
    next.invoke(request, response);
  } catch (IOException e) {
    throw new ClusteredInvocationException(e);
  } catch (ServletException e) {
    throw new ClusteredInvocationException(e);
  } finally {
    request.setRequestedSessionId(oldRequestedSessionId);
  }
  
  router.writeSessionIdWithRoutingInfo(request, response);
}

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    // TODO Is there a better way to map SSL sessions to our sesison ID?
    // TODO The request.getAttribute() will cause a number of other SSL
    //      attribute to be populated. Is this a performance concern?
    request.setRequestedSessionId(
        request.getAttribute(SSLSupport.SESSION_ID_KEY).toString());
    request.setRequestedSessionSSL(true);
  }
}

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    // TODO Is there a better way to map SSL sessions to our sesison ID?
    // TODO The request.getAttribute() will cause a number of other SSL
    //      attribute to be populated. Is this a performance concern?
    request.setRequestedSessionId(
        request.getAttribute(SSLSupport.SESSION_ID_KEY).toString());
    request.setRequestedSessionSSL(true);
  }
}

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    // TODO Is there a better way to map SSL sessions to our sesison ID?
    // TODO The request.getAttribute() will cause a number of other SSL
    //      attribute to be populated. Is this a performance concern?
    request.setRequestedSessionId(
        request.getAttribute(SSLSupport.SESSION_ID_KEY).toString());
    request.setRequestedSessionSSL(true);
  }
}

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

/* 493 */       int semicolon2 = uriBC.indexOf(';', sessionIdStart);
/* 494 */       if (semicolon2 >= 0) {
/* 495 */         request.setRequestedSessionId(new String(uriBC.getBuffer(), start + sessionIdStart, semicolon2 - sessionIdStart));
/* 506 */         request.setRequestedSessionId(new String(uriBC.getBuffer(), start + sessionIdStart, end - start - sessionIdStart));
/* 514 */       request.setRequestedSessionId(null);
/* 515 */       request.setRequestedSessionURL(false);

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    // TODO Is there a better way to map SSL sessions to our sesison ID?
    // TODO The request.getAttribute() will cause a number of other SSL
    //      attribute to be populated. Is this a performance concern?
    request.setRequestedSessionId(
        request.getAttribute(SSLSupport.SESSION_ID_KEY).toString());
    request.setRequestedSessionSSL(true);
  }
}

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

int semicolon2 = uriBC.indexOf(';', sessionIdStart);
if (semicolon2 >= 0) {
  request.setRequestedSessionId
    (new String(uriBC.getBuffer(), start + sessionIdStart, 
        semicolon2 - sessionIdStart));
  request.setRequestedSessionId
    (new String(uriBC.getBuffer(), start + sessionIdStart, 
        (end - start) - sessionIdStart));
request.setRequestedSessionId(null);
request.setRequestedSessionURL(false);

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 *
 * @param request The Servlet request object
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    String sessionId = (String) request.getAttribute(SSLSupport.SESSION_ID_KEY);
    if (sessionId != null) {
      request.setRequestedSessionId(sessionId);
      request.setRequestedSessionSSL(true);
    }
  }
}

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

/**
 * Look for SSL session ID if required. Only look for SSL Session ID if it
 * is the only tracking method enabled.
 *
 * @param request The Servlet request object
 */
protected void parseSessionSslId(Request request) {
  if (request.getRequestedSessionId() == null &&
      SSL_ONLY.equals(request.getServletContext()
          .getEffectiveSessionTrackingModes()) &&
          request.connector.secure) {
    String sessionId = (String) request.getAttribute(SSLSupport.SESSION_ID_KEY);
    if (sessionId != null) {
      request.setRequestedSessionId(sessionId);
      request.setRequestedSessionSSL(true);
    }
  }
}

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

request.setRequestedSessionId
  (scookie.getValue().toString());
request.setRequestedSessionCookie(true);
  request.setRequestedSessionId
    (scookie.getValue().toString());

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

/**
 * Parse session id in URL.
 */
protected void parseSessionCookiesId(org.apache.coyote.Request req, Request request) {
  // Parse session id from cookies
  Cookies serverCookies = req.getCookies();
  int count = serverCookies.getCookieCount();
  if (count <= 0)
    return;
  for (int i = 0; i < count; i++) {
    ServerCookie scookie = serverCookies.getCookie(i);
    if (scookie.getName().equals(Globals.SESSION_COOKIE_NAME)) {
      // Override anything requested in the URL
      if (!request.isRequestedSessionIdFromCookie()) {
        // Accept only the first session id cookie
        convertMB(scookie.getValue());
        request.setRequestedSessionId(scookie.getValue().toString());
        request.setRequestedSessionCookie(true);
        request.setRequestedSessionURL(false);
      } else {
        if (!isSessionIdValid(request, request.getRequestedSessionId())) {
          // Replace the session id until one is valid
          convertMB(scookie.getValue());
          request.setRequestedSessionId(scookie.getValue().toString());
        }
      }
    }
  }
}

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

/**
 * Parse session id in URL.
 */
protected void parseSessionCookiesId(org.apache.coyote.Request req, Request request) {
  // Parse session id from cookies
  Cookies serverCookies = req.getCookies();
  int count = serverCookies.getCookieCount();
  if (count <= 0)
    return;
  String cookieName = request.getContext().getSessionCookie().getName();
  for (int i = 0; i < count; i++) {
    ServerCookie scookie = serverCookies.getCookie(i);
    if (scookie.getName().equals(cookieName)) {
      // Override anything requested in the URL
      if (!request.isRequestedSessionIdFromCookie()) {
        // Accept only the first session id cookie
        convertMB(scookie.getValue());
        request.setRequestedSessionId(scookie.getValue().toString());
        request.setRequestedSessionCookie(true);
        request.setRequestedSessionURL(false);
      } else {
        if (!isSessionIdValid(request, request.getRequestedSessionId())) {
          // Replace the session id until one is valid
          convertMB(scookie.getValue());
          request.setRequestedSessionId(scookie.getValue().toString());
        }
      }
    }
  }
}

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

request.setRequestedSessionId
  (scookie.getValue().toString());
request.setRequestedSessionCookie(true);
  request.setRequestedSessionId
    (scookie.getValue().toString());

相关文章

Request类方法