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

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

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

Request.getPathInfo介绍

暂无

代码示例

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

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

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

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

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

  1. public Principal getUserPrincipal()
  2. {
  3. if (_userPrincipal != null && _userPrincipal instanceof SecurityHandler.NotChecked)
  4. {
  5. SecurityHandler.NotChecked not_checked=(SecurityHandler.NotChecked)_userPrincipal;
  6. _userPrincipal = SecurityHandler.__NO_USER;
  7. Authenticator auth=not_checked.getSecurityHandler().getAuthenticator();
  8. UserRealm realm=not_checked.getSecurityHandler().getUserRealm();
  9. String pathInContext=getPathInfo()==null?getServletPath():(getServletPath()+getPathInfo());
  10. if (realm != null && auth != null)
  11. {
  12. try
  13. {
  14. auth.authenticate(realm, pathInContext, this, null);
  15. }
  16. catch (Exception e)
  17. {
  18. Log.ignore(e);
  19. }
  20. }
  21. }
  22. if (_userPrincipal == SecurityHandler.__NO_USER)
  23. return null;
  24. return _userPrincipal;
  25. }

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

  1. old_path_info=base_request.getPathInfo();

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

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

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

  1. public void handle(HttpConnection connection) throws IOException, ServletException
  2. {
  3. String target=connection.getRequest().getPathInfo();
  4. if (Log.isDebugEnabled())
  5. {
  6. Log.debug("REQUEST "+target+" on "+connection);
  7. handle(target, connection.getRequest(), connection.getResponse(), Handler.REQUEST);
  8. Log.debug("RESPONSE "+target+" "+connection.getResponse().getStatus());
  9. }
  10. else
  11. handle(target, connection.getRequest(), connection.getResponse(), Handler.REQUEST);
  12. }

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

  1. String old_context_path=base_request.getContextPath();
  2. String old_servlet_path=base_request.getServletPath();
  3. String old_path_info=base_request.getPathInfo();
  4. String old_query=base_request.getQueryString();
  5. Attributes old_attr=base_request.getAttributes();

相关文章