org.eclipse.jetty.server.Request.getProtocol()方法的使用及代码示例

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

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

Request.getProtocol介绍

暂无

代码示例

代码示例来源:origin: jphp-group/jphp

@Signature
public String protocol() {
  return request.getProtocol();
}

代码示例来源:origin: apache/incubator-druid

@Override
 public void log(Request request, Response response)
 {
  if (logger.isDebugEnabled()) {
   logger.debug(
     "%s %s %s %s",
     request.getRemoteAddr(),
     request.getMethod(),
     request.getHttpURI().toString(),
     request.getProtocol()
   );
  }
 }
}

代码示例来源:origin: i2p/i2p.i2p

buf.append(request.getProtocol());
buf.append("\" ");
int status = response.getStatus();

代码示例来源:origin: com.nitorcreations/willow-logging-jetty

@Override
public String getProtocol() {
 return request.getProtocol();
}

代码示例来源:origin: com.googlecode.mycontainer/mycontainer-web

public void log(Request request, Response response) {
  if (LOG.isInfoEnabled()) {
    String remoteAddr = request.getRemoteAddr();
    String method = request.getMethod();
    String protocol = request.getProtocol();
    StringBuffer url = request.getRequestURL();
    LOG.info("Request: " + protocol + " " + method + " " + remoteAddr
        + " " + url);
  }
}

代码示例来源:origin: com.yahoo.athenz/athenz-jetty-container

buf.append(' ');
append(buf, request.getProtocol());
buf.append("\" ");

代码示例来源:origin: io.druid/druid-server

@Override
 public void log(Request request, Response response)
 {
  if (logger.isDebugEnabled()) {
   logger.debug(
     "%s %s %s %s",
     request.getRemoteAddr(),
     request.getMethod(),
     request.getHttpURI().toString(),
     request.getProtocol()
   );
  }
 }
}

代码示例来源:origin: org.apache.druid/druid-server

@Override
 public void log(Request request, Response response)
 {
  if (logger.isDebugEnabled()) {
   logger.debug(
     "%s %s %s %s",
     request.getRemoteAddr(),
     request.getMethod(),
     request.getHttpURI().toString(),
     request.getProtocol()
   );
  }
 }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

if (HttpVersions.HTTP_1_0.equalsIgnoreCase(_connection.getRequest().getProtocol()))
  response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE);
break;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

if (HttpVersions.HTTP_1_0.equalsIgnoreCase(_connection.getRequest().getProtocol()))
  response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE);
break;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

if (HttpVersions.HTTP_1_0.equalsIgnoreCase(_connection.getRequest().getProtocol()))
  response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE);
break;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

if (HttpVersions.HTTP_1_0.equalsIgnoreCase(_connection.getRequest().getProtocol()))
  response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE);
break;

代码示例来源:origin: org.eclipse.jetty/server

if (HttpVersions.HTTP_1_0.equalsIgnoreCase(_connection.getRequest().getProtocol()))
  response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE);
break;

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

public void handle(HttpChannel connection) throws IOException, ServletException
{
  final String target=connection.getRequest().getPathInfo();
  final Request request=connection.getRequest();
  final Response response=connection.getResponse();
  if (LOG.isDebugEnabled())
    LOG.debug("{} on {}{}{} {} {}{}{}", request.getDispatcherType(), connection, System.lineSeparator(),
        request.getMethod(), target, request.getProtocol(), System.lineSeparator(), request.getHttpFields());
  if (HttpMethod.OPTIONS.is(request.getMethod()) || "*".equals(target))
  {
    if (!HttpMethod.OPTIONS.is(request.getMethod()))
      response.sendError(HttpStatus.BAD_REQUEST_400);
    handleOptions(request,response);
    if (!request.isHandled())
      handle(target, request, request, response);
  }
  else
    handle(target, request, request, response);
  if (LOG.isDebugEnabled())
    LOG.debug("RESPONSE for {} h={}{}{} {}{}{}", target, request.isHandled(), System.lineSeparator(),
        response.getStatus(), response.getReason(), System.lineSeparator(), response.getHttpFields());
}

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

if (HttpVersion.HTTP_1_0.is(_channel.getRequest().getProtocol()))
  _fields.put(HttpHeader.CONNECTION, HttpHeaderValue.KEEP_ALIVE.toString());
break;

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

if (HttpVersion.HTTP_1_0.is(_channel.getRequest().getProtocol()))
  _fields.put(HttpHeader.CONNECTION, HttpHeaderValue.KEEP_ALIVE.toString());
break;

代码示例来源:origin: jboss-fuse/fabric8

@Override
public void log(Request request, Response response) {
  try {
    if (!enabled) {
      return;
    }
    StorageService s = storage.getService();
    if (s == null) {
      return;
    }
    if (ignorePathMap != null && ignorePathMap.getMatch(request.getRequestURI()) != null)
      return;
    String output = "{ " +
        "\"host\": \"" + host + "\", " +
        "\"@timestamp\": \"" + InsightUtils.formatDate(request.getTimeStamp()) + "\", " +
        "\"remote\": \"" + request.getRemoteAddr() + "\", " +
        "\"user\": \"" + (request.getAuthentication() instanceof Authentication.User ? ((Authentication.User)request.getAuthentication()).getUserIdentity().getUserPrincipal().getName() : "") + "\", " +
        "\"method\": \"" + request.getMethod() + "\", " +
        "\"uri\": \"" + request.getUri().toString() + "\", " +
        "\"protocol\": \"" + request.getProtocol() + "\", " +
        "\"status\": \"" + response.getStatus() + "\", " +
        "\"responseLength\": \"" + response.getContentCount() + "\" " +
        " }";
    s.store(type, request.getTimeStamp(), output);
  }
  catch (Exception e)
  {
    LOG.warn(e);
  }
}

代码示例来源:origin: Nextdoor/bender

if (HttpVersion.HTTP_1_0.is(_channel.getRequest().getProtocol()))
  _fields.put(HttpHeader.CONNECTION, HttpHeaderValue.KEEP_ALIVE.toString());
break;

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

if (HttpVersion.HTTP_1_0.is(_channel.getRequest().getProtocol()))
  _fields.put(HttpHeader.CONNECTION, HttpHeaderValue.KEEP_ALIVE.toString());
break;

代码示例来源:origin: jenkinsci/winstone

public void log(Request request, Response response) {
  String uriLine = request.getMethod() + " " + request.getRequestURI() + " " + request.getProtocol();
  int status = response.getStatus();
  long size = response.getContentCount();

相关文章

Request类方法