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

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

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

Request.getHeader介绍

[英]Return the first value of the specified header, if any; otherwise, return null
[中]返回指定标头的第一个值(如果有);否则,返回null

代码示例

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

@Override
public String resolveHttp(String key) {
  String header = request.getHeader(key);
  if (header == null) {
    return "";
  } else {
    return header;
  }
}

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

public String mygetHeader(Request request, String header) {
  String strcert0 = request.getHeader(header);
  if (strcert0 == null) {
    return null;
  }
  /* mod_header writes "(null)" when the ssl variable is no filled */
  if ("(null)".equals(strcert0)) {
    return null;
  }
  return strcert0;
}

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

public String mygetHeader(Request request, String header) {
  String strcert0 = request.getHeader(header);
  if (strcert0 == null)
    return null;
  /* mod_header writes "(null)" when the ssl variable is no filled */
  if ("(null)".equals(strcert0))
    return null;
  return strcert0;
} 
public void invoke(Request request, Response response)

代码示例来源: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.getHeader(header)));
  }
}

代码示例来源:origin: org.picketlink.distribution/picketlink-jbas7

private boolean isAjaxRequest(Request request) {
    String requestedWithHeader = request.getHeader(GeneralConstants.HTTP_HEADER_X_REQUESTED_WITH);
    return requestedWithHeader != null && "XMLHttpRequest".equalsIgnoreCase(requestedWithHeader);
  }
}

代码示例来源:origin: org.picketlink.distribution/picketlink-jbas5

private boolean isAjaxRequest(Request request) {
    String requestedWithHeader = request.getHeader(GeneralConstants.HTTP_HEADER_X_REQUESTED_WITH);
    return requestedWithHeader != null && "XMLHttpRequest".equalsIgnoreCase(requestedWithHeader);
  }
}

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

private boolean hasNonZeroContentLength(final Request request) {
  try {
    final String contentLength = request.getHeader("Content-Length");
    if (contentLength == null) return false;
    if (Integer.parseInt(contentLength) > 0) return true;
  } catch (NumberFormatException ignore) {
    // ignore
  }
  return false;
}

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

public String mygetHeader(Request request, String header) {
  String strcert0 = request.getHeader(header);
  if (strcert0 == null) {
    return null;
  }
  /* mod_header writes "(null)" when the ssl variable is no filled */
  if ("(null)".equals(strcert0)) {
    return null;
  }
  return strcert0;
}
@Override

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

public String mygetHeader(Request request, String header) {
  String strcert0 = request.getHeader(header);
  if (strcert0 == null)
    return null;
  /* mod_header writes "(null)" when the ssl variable is no filled */
  if ("(null)".equals(strcert0))
    return null;
  return strcert0;
} 
@Override

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

public void addElement(StringBuilder buf, Date date, Request request,
      Response response, long time) {
    String value = request.getHeader(header);
    if (value == null) {
      buf.append('-');
    } else {
      buf.append(value);
    }
  }
}

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

@Override
  public void addElement(StringBuilder buf, Date date, Request request,
      Response response, long time) {
    String value = request.getHeader(header);
    if (value == null) {
      buf.append('-');
    } else {
      buf.append(value);
    }
  }
}

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

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

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

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

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

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

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

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

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

public String getHeader(String name) {
  if (request == null) {
    throw MESSAGES.nullRequestFacade();
  }
  return request.getHeader(name);
}

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

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

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

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

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

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

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

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

相关文章

Request类方法