org.apache.coyote.Response.containsHeader()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(96)

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

Response.containsHeader介绍

[英]Warning: This method always returns false[[$0$]]
[中]警告:此方法始终返回false[[$0$]]

代码示例

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

/*      */   public boolean containsHeader(String name)
/*      */   {
/* 1056 */     char cc = name.charAt(0);
/* 1057 */     if ((cc == 'C') || (cc == 'c')) {
/* 1058 */       if (name.equalsIgnoreCase("Content-Type"))
/*      */       {
/* 1060 */         return this.coyoteResponse.getContentType() != null;
/*      */       }
/* 1062 */       if (name.equalsIgnoreCase("Content-Length"))
/*      */       {
/* 1064 */         return this.coyoteResponse.getContentLengthLong() != -1L;
/*      */       }
/*      */     }
/*      */ 
/* 1068 */     return this.coyoteResponse.containsHeader(name);
/*      */   }
/*      */

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (coyoteResponse.getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (coyoteResponse.getContentLengthLong() != -1);
    }
  }
  return coyoteResponse.containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 * @return <code>true</code> if the header has been set
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (getCoyoteResponse().getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (getCoyoteResponse().getContentLengthLong() != -1);
    }
  }
  return getCoyoteResponse().containsHeader(name);
}

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

/**
 * Has the specified header been set already in this response?
 *
 * @param name Name of the header to check
 * @return <code>true</code> if the header has been set
 */
@Override
public boolean containsHeader(String name) {
  // Need special handling for Content-Type and Content-Length due to
  // special handling of these in coyoteResponse
  char cc=name.charAt(0);
  if(cc=='C' || cc=='c') {
    if(name.equalsIgnoreCase("Content-Type")) {
      // Will return null if this has not been set
      return (getCoyoteResponse().getContentType() != null);
    }
    if(name.equalsIgnoreCase("Content-Length")) {
      // -1 means not known and is not sent to client
      return (getCoyoteResponse().getContentLengthLong() != -1);
    }
  }
  return getCoyoteResponse().containsHeader(name);
}

代码示例来源:origin: org.glassfish.metro/webservices-extra

if (! response.containsHeader("Date")){
  String date = FastHttpDateFormat.getCurrentDate();
  response.addHeader("Date", date);

相关文章

微信公众号

最新文章

更多