org.mortbay.jetty.Request.getPathInfo()方法的使用及代码示例

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

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

Request.getPathInfo介绍

暂无

代码示例

代码示例来源:origin: Netflix/eureka

private void sendOkResponseWithContent(Request request, HttpServletResponse response, String content)
      throws IOException {
    response.setContentType("application/json; charset=UTF-8");
    response.setStatus(HttpServletResponse.SC_OK);
    response.getOutputStream().write(content.getBytes("UTF-8"));
    response.getOutputStream().flush();
    request.setHandled(true);
    System.out.println("Eureka resource mock, sent response for request path: " + request.getPathInfo() +
        " with content" + content);
  }
}

代码示例来源:origin: Netflix/eureka

protected void sendOkResponseWithContent(Request request, HttpServletResponse response, Applications apps)
    throws IOException {
  String content = XmlXStream.getInstance().toXML(apps);
  response.setContentType("application/xml");
  response.setStatus(HttpServletResponse.SC_OK);
  response.getWriter().println(content);
  response.getWriter().flush();
  request.setHandled(true);
  System.out.println("Eureka port: " + port + ". " + System.currentTimeMillis() +
      ". Eureka resource mock, sent response for request path: " + request.getPathInfo() +
      ", apps count: " + apps.getRegisteredApplications().size());
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public Principal getUserPrincipal()
{
  if (_userPrincipal != null && _userPrincipal instanceof SecurityHandler.NotChecked)
  {
    SecurityHandler.NotChecked not_checked=(SecurityHandler.NotChecked)_userPrincipal;
    _userPrincipal = SecurityHandler.__NO_USER;
    
    Authenticator auth=not_checked.getSecurityHandler().getAuthenticator();
    UserRealm realm=not_checked.getSecurityHandler().getUserRealm();
    String pathInContext=getPathInfo()==null?getServletPath():(getServletPath()+getPathInfo());
    
    if (realm != null && auth != null)
    {
      try
      {
        auth.authenticate(realm, pathInContext, this, null);
      }
      catch (Exception e)
      {
        Log.ignore(e);
      }
    }
  }
  
  if (_userPrincipal == SecurityHandler.__NO_USER) 
    return null;
  return _userPrincipal;
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

old_path_info=base_request.getPathInfo();

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

final String old_servlet_name=base_request.getServletName();
final String old_servlet_path=base_request.getServletPath();
final String old_path_info=base_request.getPathInfo();
final Map old_role_map=base_request.getRoleMap();

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public void handle(HttpConnection connection) throws IOException, ServletException
{
  String target=connection.getRequest().getPathInfo();
  if (Log.isDebugEnabled())
  {
    Log.debug("REQUEST "+target+" on "+connection);
    handle(target, connection.getRequest(), connection.getResponse(), Handler.REQUEST);
    Log.debug("RESPONSE "+target+"  "+connection.getResponse().getStatus());
  }
  else
    handle(target, connection.getRequest(), connection.getResponse(), Handler.REQUEST);
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

String old_context_path=base_request.getContextPath();
String old_servlet_path=base_request.getServletPath();
String old_path_info=base_request.getPathInfo();
String old_query=base_request.getQueryString();
Attributes old_attr=base_request.getAttributes();

相关文章