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

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

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

Request.getServerName介绍

暂无

代码示例

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

  1. public StringBuffer getRequestURL()
  2. {
  3. StringBuffer url = new StringBuffer(48);
  4. synchronized (url)
  5. {
  6. String scheme = getScheme();
  7. int port = getServerPort();
  8. url.append(scheme);
  9. url.append("://");
  10. url.append(getServerName());
  11. if (_port>0 &&
  12. ((scheme.equalsIgnoreCase(URIUtil.HTTP) && port != 80) ||
  13. (scheme.equalsIgnoreCase(URIUtil.HTTPS) && port != 443)))
  14. {
  15. url.append(':');
  16. url.append(_port);
  17. }
  18. url.append(getRequestURI());
  19. return url;
  20. }
  21. }

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

  1. /**
  2. * Reconstructs the URL the client used to make the request. The returned URL contains a
  3. * protocol, server name, port number, and, but it does not include a path.
  4. * <p>
  5. * Because this method returns a <code>StringBuffer</code>, not a string, you can modify the
  6. * URL easily, for example, to append path and query parameters.
  7. *
  8. * This method is useful for creating redirect messages and for reporting errors.
  9. *
  10. * @return "scheme://host:port"
  11. */
  12. public StringBuffer getRootURL()
  13. {
  14. StringBuffer url = new StringBuffer(48);
  15. synchronized (url)
  16. {
  17. String scheme = getScheme();
  18. int port = getServerPort();
  19. url.append(scheme);
  20. url.append("://");
  21. url.append(getServerName());
  22. if (port > 0 && ((scheme.equalsIgnoreCase("http") && port != 80) || (scheme.equalsIgnoreCase("https") && port != 443)))
  23. {
  24. url.append(':');
  25. url.append(port);
  26. }
  27. return url;
  28. }
  29. }

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

  1. public int getServerPort()
  2. {
  3. if (_port<=0)
  4. {
  5. if (_serverName==null)
  6. getServerName();
  7. if (_port<=0)
  8. {
  9. if (_serverName!=null && _uri!=null)
  10. _port = _uri.getPort();
  11. else
  12. _port = _endp==null?0:_endp.getLocalPort();
  13. }
  14. }
  15. if (_port<=0)
  16. {
  17. if (getScheme().equalsIgnoreCase(URIUtil.HTTPS))
  18. return 443;
  19. return 80;
  20. }
  21. return _port;
  22. }

代码示例来源:origin: com.twitter.common/net-http

  1. private String formatEntry(Request request, Response response) {
  2. StringBuilder buf = new StringBuilder();
  3. buf.append(request.getServerName());
  4. buf.append(' ');

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

  1. buf.append(request.getServerName());
  2. buf.append(' ');

代码示例来源:origin: org.mortbay.jetty/jetty-security

  1. session.setAttribute(__J_URI,
  2. request.getScheme() +
  3. "://" + request.getServerName() +
  4. ":" + request.getServerPort() +
  5. URIUtil.addPaths(request.getContextPath(),uri));

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

  1. session.setAttribute(__J_URI,
  2. request.getScheme() +
  3. "://" + request.getServerName() +
  4. ":" + request.getServerPort() +
  5. URIUtil.addPaths(request.getContextPath(),uri));

代码示例来源:origin: org.mortbay.jetty/jetty-security

  1. connector.getIntegralScheme()
  2. + "://"
  3. + request.getServerName()
  4. + ":"
  5. + connector.getIntegralPort()
  6. connector.getConfidentialScheme()
  7. + "://"
  8. + request.getServerName()
  9. + ":"
  10. + connector.getConfidentialPort()

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

  1. connector.getIntegralScheme()
  2. + "://"
  3. + request.getServerName()
  4. + ":"
  5. + connector.getIntegralPort()
  6. connector.getConfidentialScheme()
  7. + "://"
  8. + request.getServerName()
  9. + ":"
  10. + connector.getConfidentialPort()

相关文章