org.glassfish.grizzly.http.server.Request.getHeaders()方法的使用及代码示例

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

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

Request.getHeaders介绍

[英]Return all of the values of the specified header, if any; otherwise, return an empty enumeration.
[中]返回指定标题的所有值(如果有);否则,返回一个空枚举。

代码示例

代码示例来源:origin: jersey/jersey

@Override
public void service(final Request request, final Response response) {
  final ResponseWriter responseWriter = new ResponseWriter(response, configSetStatusOverSendError);
  try {
    logger.debugLog("GrizzlyHttpContainer.service(...) started");
    URI baseUri = getBaseUri(request);
    URI requestUri = getRequestUri(request);
    final ContainerRequest requestContext = new ContainerRequest(baseUri,
        requestUri, request.getMethod().getMethodString(),
        getSecurityContext(request), new GrizzlyRequestPropertiesDelegate(request));
    requestContext.setEntityStream(request.getInputStream());
    for (final String headerName : request.getHeaderNames()) {
      requestContext.headers(headerName, request.getHeaders(headerName));
    }
    requestContext.setWriter(responseWriter);
    requestContext.setRequestScopedInitializer(injectionManager -> {
      injectionManager.<Ref<Request>>getInstance(RequestTYPE).set(request);
      injectionManager.<Ref<Response>>getInstance(ResponseTYPE).set(response);
    });
    appHandler.handle(requestContext);
  } finally {
    logger.debugLog("GrizzlyHttpContainer.service(...) finished");
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

@Override
  public Enumeration<String> run() {
    return new Enumerator<>(request.getHeaders(name));
  }           
}

代码示例来源:origin: javaee/grizzly

@Override
  public Enumeration<String> run() {
    return new Enumerator<>(request.getHeaders(name));
  }           
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  public Enumeration<String> run() {
    return new Enumerator<>(request.getHeaders(name));
  }           
}

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  public Enumeration<String> run() {
    return new Enumerator<>(request.getHeaders(name));
  }           
}

代码示例来源:origin: javaee/grizzly

@Override
  public Enumeration<String> run() {
    return new Enumerator<>(request.getHeaders(name));
  }           
}

代码示例来源:origin: javaee/grizzly

@Override
  public Enumeration<String> run() {
    return new Enumerator<>(request.getHeaders(name));
  }           
}

代码示例来源:origin: javaee/grizzly

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

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

/**
 * Return all of the values of the specified header, if any; otherwise,
 * return an empty enumeration.
 *
 * @param name Name of the requested header
 */
@Override
public Enumeration<String> getHeaders(String name) {
  return new Enumerator<String>(coyoteRequest.getHeaders(name).iterator());
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * Parse request locales.
 */
protected void parseLocales() {
  localesParsed = true;
  final Iterable<String> values = getHeaders("accept-language");
  for (String value : values) {
    parseLocalesHeader(value);
  }
}

代码示例来源:origin: javaee/grizzly

public static void writeTraceMessage(final Request request,
    final Response response) throws IOException {
  response.setStatus(HttpStatus.OK_200);
  response.setContentType("message/http");
  final Writer writer = response.getWriter();
  writer.append(request.getMethod().toString()).append(' ')
      .append(request.getRequest().getRequestURIRef().getOriginalRequestURIBC().toString())
      .append(' ').append(request.getProtocol().getProtocolString())
      .append("\r\n");
  for (String headerName : request.getHeaderNames()) {
    for (String headerValue : request.getHeaders(headerName)) {
      writer.append(headerName).append(": ").append(headerValue).append("\r\n");
    }
  }
}

相关文章

Request类方法