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

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

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

Response.getContentLanguage介绍

[英]Return the content language.
[中]返回内容语言。

代码示例

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

/**
 * When committing the response, we have to validate the set of headers, as
 * well as setup the response filters.
 */
protected void sendSynReply() {
  response.setCommitted(true);
  // Special headers
  MimeHeaders headers = response.getMimeHeaders();
  String contentType = response.getContentType();
  if (contentType != null) {
    headers.setValue("Content-Type").setString(contentType);
  }
  String contentLanguage = response.getContentLanguage();
  if (contentLanguage != null) {
    headers.setValue("Content-Language").setString(contentLanguage);
  }
  long contentLength = response.getContentLengthLong();
  if (contentLength >= 0) {
    headers.setValue("Content-Length").setLong(contentLength);
  }
  sendResponseHead();
}

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

/**
 * When committing the response, we have to validate the set of headers, as
 * well as setup the response filters.
 */
protected void sendSynReply() {
  response.setCommitted(true);
  // Special headers
  MimeHeaders headers = response.getMimeHeaders();
  String contentType = response.getContentType();
  if (contentType != null) {
    headers.setValue("Content-Type").setString(contentType);
  }
  String contentLanguage = response.getContentLanguage();
  if (contentLanguage != null) {
    headers.setValue("Content-Language").setString(contentLanguage);
  }
  long contentLength = response.getContentLengthLong();
  if (contentLength >= 0) {
    headers.setValue("Content-Length").setLong(contentLength);
  }
  sendResponseHead();
}

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

static void prepareHeaders(Request coyoteRequest, Response coyoteResponse, boolean noSendfile,
    Http2Protocol protocol, Stream stream) {
  MimeHeaders headers = coyoteResponse.getMimeHeaders();
  int statusCode = coyoteResponse.getStatus();
  // Add the pseudo header for status
  headers.addValue(":status").setString(Integer.toString(statusCode));
  // Check to see if a response body is present
  if (!(statusCode < 200 || statusCode == 205 || statusCode == 304)) {
    String contentType = coyoteResponse.getContentType();
    if (contentType != null) {
      headers.setValue("content-type").setString(contentType);
    }
    String contentLanguage = coyoteResponse.getContentLanguage();
    if (contentLanguage != null) {
      headers.setValue("content-language").setString(contentLanguage);
    }
  }
  // Add date header unless it is an informational response or the
  // application has already set one
  if (statusCode >= 200 && headers.getValue("date") == null) {
    headers.addValue("date").setString(FastHttpDateFormat.getCurrentDate());
  }
  // Compression can't be used with sendfile
  if (noSendfile && protocol != null &&
      protocol.useCompression(coyoteRequest, coyoteResponse)) {
    // Enable compression. Headers will have been set. Need to configure
    // output filter at this point.
    stream.addOutputFilter(new GzipOutputFilter());
  }
}

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = res.getContentLanguage();
if( contentLanguage != null ) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language").setString(contentLanguage);

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language")

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

String contentLanguage = response.getContentLanguage();
if (contentLanguage != null && !"".equals(contentLanguage)) {
  headers.setValue("Content-Language")

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language")

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language")

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

headers.setValue("Content-Type").setString(contentType);
String contentLanguage = response.getContentLanguage();
if (contentLanguage != null) {
  headers.setValue("Content-Language")

相关文章