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

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

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

Request.getUri介绍

暂无

代码示例

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

buf.append(' ');
request.getUri().writeTo(u8buf);

代码示例来源:origin: org.sonatype.plexus/plexus-jetty-testsuite

protected void addUri( HttpServletRequest req )
{
  String uri = ( (Request) req ).getUri().toString();
  if ( !accessedUrls.contains( uri ) )
  {
    accessedUrls.add( uri );
  }
}

代码示例来源:origin: org.sonatype.plexus/plexus-jetty-testsuite

@Override
public final void service( ServletRequest request, ServletResponse response )
  throws ServletException, IOException
{
  HttpServletRequest req = (HttpServletRequest) request;
  HttpServletResponse res = (HttpServletResponse) response;
  String uri = ( (Request) req ).getUri().toString();
  if ( !uri.endsWith( ".sha1" ) && !uri.endsWith( ".md5" ) )
  {
    accessedUrls.add( uri );
  }
  service( req, res );
}

代码示例来源:origin: org.sonatype.plexus/plexus-jetty-testsuite

private void addUris( ServletRequest req, ServletResponse res )
  throws ServletException,
    IOException
{
  String uri = ( (Request) req ).getUri().toString();
  getAccessedUris().add( uri );
  super.service( req, res );
}

代码示例来源:origin: org.sonatype.http-testing-harness/server-provider

String uri = ((Request) req).getUri().toString();
getAccessedUris().add(uri);
super.service(req, res);

代码示例来源:origin: org.restlet.jee/org.restlet.ext.jetty

/**
 * Returns the URI on the request line (most like a relative reference, but
 * not necessarily).
 * 
 * @return The URI on the request line.
 */
@Override
public String getRequestUri() {
  return getConnection().getRequest().getUri().toString();
}

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

@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  if (HttpMethods.CONNECT.equalsIgnoreCase(request.getMethod()))
  {
    LOG.debug("CONNECT request for {}", request.getRequestURI());
    try
    {
      handleConnect(baseRequest, request, response, request.getRequestURI());
    }
    catch(Exception e)
    {
      LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e);
      LOG.debug(e);
    }
  }
  else
  {
    super.handle(target, baseRequest, request, response);
  }
}

代码示例来源:origin: stackoverflow.com

shutdown = request.getUri().equals(SHUTDOWN_COMMAND);

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

@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  if (HttpMethods.CONNECT.equalsIgnoreCase(request.getMethod()))
  {
    LOG.debug("CONNECT request for {}", request.getRequestURI());
    try
    {
      handleConnect(baseRequest, request, response, request.getRequestURI());
    }
    catch(Exception e)
    {
      LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e);
      LOG.debug(e);
    }
  }
  else
  {
    super.handle(target, baseRequest, request, response);
  }
}

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

@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  if (HttpMethods.CONNECT.equalsIgnoreCase(request.getMethod()))
  {
    LOG.debug("CONNECT request for {}", request.getRequestURI());
    try
    {
      handleConnect(baseRequest, request, response, request.getRequestURI());
    }
    catch(Exception e)
    {
      LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e);
      LOG.debug(e);
    }
  }
  else
  {
    super.handle(target, baseRequest, request, response);
  }
}

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

@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  if (HttpMethods.CONNECT.equalsIgnoreCase(request.getMethod()))
  {
    LOG.debug("CONNECT request for {}", request.getRequestURI());
    try
    {
      handleConnect(baseRequest, request, response, request.getRequestURI());
    }
    catch(Exception e)
    {
      LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e);
      LOG.debug(e);
    }
  }
  else
  {
    super.handle(target, baseRequest, request, response);
  }
}

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

@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  if (HttpMethods.CONNECT.equalsIgnoreCase(request.getMethod()))
  {
    LOG.debug("CONNECT request for {}", request.getRequestURI());
    try
    {
      handleConnect(baseRequest, request, response, request.getRequestURI());
    }
    catch(Exception e)
    {
      LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e);
      LOG.debug(e);
    }
  }
  else
  {
    super.handle(target, baseRequest, request, response);
  }
}

代码示例来源:origin: timurstrekalov/saga

uri = ((Request) request).getUri().toString();
} else {
  uri = request.getRequestURI();

代码示例来源:origin: tcplugins/tcWebHooks

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  response.setContentType(request.getContentType());
  response.setStatus(this.response);
  switch (this.response) {
    case  HttpServletResponse.SC_OK:
      if (request.getContentType() != null && request.getContentType().startsWith("application/x-www-form-urlencoded")) {
        response.setContentType("text/plain");
        this.printParams(request, response);
      } else {
        String requestBody = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8.name());
        if (callback != null){
          callback.updateRequestBody(requestBody);
        }
        response.getWriter().println(requestBody);
      }
      break;
    case HttpServletResponse.SC_MOVED_TEMPORARILY:
      response.sendRedirect("/200");
      break;
    default:
      response.getWriter().println("<h1>Hello from default</h1>");
      break;
  }
  System.out.println("Handling Web request for " + ((Request) request).getUri().toString());
}

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

String name=(String)request.getAttribute("org.eclipse.jetty.thread.name");
if (name==null)
  name=old_name+":"+baseRequest.getScheme()+"://"+baseRequest.getLocalAddr()+":"+baseRequest.getLocalPort()+baseRequest.getUri();
else
  retry=true;

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

String name=(String)request.getAttribute("org.eclipse.jetty.thread.name");
if (name==null)
  name=old_name+":"+baseRequest.getScheme()+"://"+baseRequest.getLocalAddr()+":"+baseRequest.getLocalPort()+baseRequest.getUri();
else
  retry=true;

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

String name=(String)request.getAttribute("org.eclipse.jetty.thread.name");
if (name==null)
  name=old_name+":"+baseRequest.getScheme()+"://"+baseRequest.getLocalAddr()+":"+baseRequest.getLocalPort()+baseRequest.getUri();
else
  retry=true;

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

String name=(String)request.getAttribute("org.eclipse.jetty.thread.name");
if (name==null)
  name=old_name+":"+baseRequest.getScheme()+"://"+baseRequest.getLocalAddr()+":"+baseRequest.getLocalPort()+baseRequest.getUri();
else
  retry=true;

代码示例来源:origin: stackoverflow.com

OAuthAccessor accessor = getAccessor();
accessor.accessToken = access_token;
OAuthMessage request2 = accessor.newRequestMessage(null, request.getUri().toString(), Collections.<Map.Entry<?, ?>>emptySet(), request.getEntityStream());
Object accepted = accessor.consumer.getProperty(OAuthConsumer.ACCEPT_ENCODING);
if (accepted != null) {

代码示例来源: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);
  }
}

相关文章

Request类方法