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

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

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

Request.getAttribute介绍

[英]Return the specified request attribute if it exists; otherwise, return null.
[中]返回指定的请求属性(如果存在);否则,返回null

代码示例

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

@SuppressWarnings("unchecked")
Map<String, String> getSessionVersionsRequestAttribute() {
  return (Map<String, String>) getAttribute(
      Globals.SESSION_VERSIONS_REQUEST_ATTRIBUTE);
}

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

public void addElement(StringBuilder buf, Date date, Request request,
      Response response, long time) {
    buf.append(wrap(request.getAttribute(attribute)));
  }        
}

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

@Override
  public void addElement(StringBuilder buf, Date date, Request request,
      Response response, long time) {
    buf.append(wrap(request.getAttribute(attribute)));
  }        
}

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

@Override
  public void addElement(StringBuilder buf, Date date, Request request,
      Response response, long time) {
    buf.append(wrap(request.getAttribute(attribute)));
  }
}

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

@Override
public String resolveEnv(String key) {
  Object result = request.getAttribute(key);
  return (result != null) ? result.toString() : System.getProperty(key);
}

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

@Override
public String resolveEnv(String key) {
  Object result = request.getAttribute(key);
  return (result != null) ? result.toString() : System.getProperty(key);
}

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

@Override
public Object getAttribute(String name) {
  if (request == null) {
    throw new IllegalStateException(rb.getString(LogFacade.CANNOT_USE_REQUEST_OBJECT_OUTSIDE_SCOPE_EXCEPTION));
  }
  return request.getAttribute(name);
}

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

@Override
public String resolveEnv(String key) {
  Object result = request.getAttribute(key);
  return (result != null) ? result.toString() : System.getProperty(key);
}

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

@Override
public Object getAttribute(String name) {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getAttribute(name);
}

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

public Object getAttribute(String name) {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getAttribute(name);
}

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

@Override
public Object getAttribute(String name) {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getAttribute(name);
}

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

@Override
public Object getAttribute(String name) {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getAttribute(name);
}

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

@Override
public Object getAttribute(String name) {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getAttribute(name);
}

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

@Override
  public void addElement(CharArrayWriter buf, Date date, Request request,
      Response response, long time) {
    buf.append(wrap(request.getAttribute(attribute)));
  }
}

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

public X509Certificate[] getCertificateChain() {
  X509Certificate certs[] = (X509Certificate[]) getAttribute(Globals.CERTIFICATES_ATTR);
  if ((certs == null) || (certs.length < 1)) {
    coyoteRequest.action(ActionCode.ACTION_REQ_SSL_CERTIFICATE, 
        coyoteRequest);
    certs = (X509Certificate[]) coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
    if (certs != null) {
      attributes.put(Globals.CERTIFICATES_ATTR, certs);
    }
  }
  return certs;
}

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

/**
 * Return the names of all request attributes for this Request, or an
 * empty <code>Enumeration</code> if there are none.
 */
public Enumeration getAttributeNames() {
  if (isSecure()) {
    getAttribute(Globals.CERTIFICATES_ATTR);
  }
  return new Enumerator(attributes.keySet(), true);
}

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

@Override
  public void addElement(CharArrayWriter buf, Date date, Request request,
      Response response, long time) {
    buf.append(wrap(request.getAttribute(attribute)));
  }
}

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

@Override
public void setTimeout(int timeout) throws IOException, ServletException,
    UnsupportedOperationException {
  if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE) {
    request.setAttribute("org.apache.tomcat.comet.timeout", Integer.valueOf(timeout));
    if (request.isComet()) {
      request.setCometTimeout(timeout);
    }
  } else {
    throw new UnsupportedOperationException();
  }
}

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

public void setTimeout(int timeout) throws IOException, ServletException,
    UnsupportedOperationException {
  if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE) {
    request.setAttribute("org.apache.tomcat.comet.timeout", Integer.valueOf(timeout));
    if (request.isComet()) request.setCometTimeout(timeout);
  } else {
    throw new UnsupportedOperationException();
  }
}

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

public void setTimeout(int timeout) throws IOException, ServletException,
    UnsupportedOperationException {
  if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE) {
    request.setAttribute("org.apache.tomcat.comet.timeout", Integer.valueOf(timeout));
    if (request.isComet()) request.setCometTimeout(timeout);
  } else {
    throw new UnsupportedOperationException();
  }
}

相关文章

Request类方法