com.sun.grizzly.tcp.http11.GrizzlyResponse.setHeader()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(72)

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

GrizzlyResponse.setHeader介绍

[英]Set the specified header to the specified value.
[中]将指定的标头设置为指定的值。

代码示例

代码示例来源:origin: com.sun.grizzly/grizzly-http-servlet

/**
 * {@inheritDoc}
 */
public void setHeader(String name, String value) {
  if (isCommitted())
    return;
  response.setHeader(name, value);
}

代码示例来源:origin: org.glassfish.external/grizzly-module

/**
 * Set the specified integer header to the specified value.
 *
 * @param name Name of the header to set
 * @param value Integer value to be set
 */
public void setIntHeader(String name, int value) {
  if (isCommitted())
    return;
  // Ignore any call from an included servlet
  if (included)
    return;
  setHeader(name, "" + value);
}

代码示例来源:origin: com.sun.grizzly/grizzly-utils

/**
 * Set the specified integer header to the specified value.
 *
 * @param name Name of the header to set
 * @param value Integer value to be set
 */
public void setIntHeader(String name, int value) {
  if (isCommitted())
    return;
  // Ignore any call from an included servlet
  if (included)
    return;
  setHeader(name, "" + value);
}

代码示例来源:origin: com.sun.grizzly/grizzly-http-utils

/**
 * Set the specified integer header to the specified value.
 *
 * @param name Name of the header to set
 * @param value Integer value to be set
 */
public void setIntHeader(String name, int value) {
  if (isCommitted())
    return;
  // Ignore any call from an included servlet
  if (included)
    return;
  setHeader(name, "" + value);
}

代码示例来源:origin: org.glassfish.external/grizzly-module

/**
 * Set the specified date header to the specified value.
 *
 * @param name Name of the header to set
 * @param value Date value to be set
 */
public void setDateHeader(String name, long value) {
  if (isCommitted())
    return;
  // Ignore any call from an included servlet
  if (included) {
    return;
  }
  if (format == null) {
    format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER,
                   Locale.US);
    format.setTimeZone(TimeZone.getTimeZone("GMT"));
  }
  setHeader(name, FastHttpDateFormat.formatDate(value, format));
}

代码示例来源:origin: com.sun.grizzly/grizzly-http-utils

/**
 * Set the specified date header to the specified value.
 *
 * @param name Name of the header to set
 * @param value Date value to be set
 */
public void setDateHeader(String name, long value) {
  if (isCommitted())
    return;
  // Ignore any call from an included servlet
  if (included) {
    return;
  }
  if (format == null) {
    format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER,
                   Locale.US);
    format.setTimeZone(TimeZone.getTimeZone("GMT"));
  }
  setHeader(name, FastHttpDateFormat.formatDate(value, format));
}

代码示例来源:origin: com.sun.grizzly/grizzly-utils

/**
 * Set the specified date header to the specified value.
 *
 * @param name Name of the header to set
 * @param value Date value to be set
 */
public void setDateHeader(String name, long value) {
  if (isCommitted())
    return;
  // Ignore any call from an included servlet
  if (included) {
    return;
  }
  if (format == null) {
    format = new SimpleDateFormat(HTTP_RESPONSE_DATE_HEADER,
                   Locale.US);
    format.setTimeZone(TimeZone.getTimeZone("GMT"));
  }
  setHeader(name, FastHttpDateFormat.formatDate(value, format));
}

代码示例来源:origin: com.sun.grizzly/grizzly-utils

setHeader("Location", absolute);

代码示例来源:origin: com.sun.grizzly/grizzly-http-utils

setHeader("Location", absolute);
} catch (IllegalArgumentException e) {
  setStatus(404);

代码示例来源:origin: org.glassfish.external/grizzly-module

setHeader("Location", absolute);
} catch (IllegalArgumentException e) {
  setStatus(404);

相关文章

微信公众号

最新文章

更多