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

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

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

Request.getHeader介绍

暂无

代码示例

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

  1. protected void logExtended(Request request,
  2. Response response,
  3. Writer writer) throws IOException
  4. {
  5. String referer = request.getHeader(HttpHeaders.REFERER);
  6. if (referer == null)
  7. writer.write("\"-\" ");
  8. else
  9. {
  10. writer.write('"');
  11. writer.write(referer);
  12. writer.write("\" ");
  13. }
  14. String agent = request.getHeader(HttpHeaders.USER_AGENT);
  15. if (agent == null)
  16. writer.write("\"-\" ");
  17. else
  18. {
  19. writer.write('"');
  20. writer.write(agent);
  21. writer.write('"');
  22. }
  23. }

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

  1. buf.append(' ');
  2. String addr = request.getHeader(HttpHeaders.X_FORWARDED_FOR);
  3. if (addr == null) {
  4. addr = request.getRemoteAddr();
  5. buf.append(' ');
  6. String referer = request.getHeader(HttpHeaders.REFERER);
  7. if (referer == null) {
  8. buf.append("\"-\" ");
  9. String agent = request.getHeader(HttpHeaders.USER_AGENT);
  10. if (agent == null) {
  11. buf.append("\"-\" ");

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

  1. if (_preferProxiedForAddress)
  2. addr = request.getHeader(HttpHeaders.X_FORWARDED_FOR);

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

  1. String credentials = request.getHeader(HttpHeaders.AUTHORIZATION);

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

  1. String credentials = request.getHeader(HttpHeaders.AUTHORIZATION);

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

  1. String credentials = request.getHeader(HttpHeaders.AUTHORIZATION);

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

  1. String credentials = request.getHeader(HttpHeaders.AUTHORIZATION);

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

  1. public void sendProcessing() throws IOException
  2. {
  3. Generator g = _connection.getGenerator();
  4. if (g instanceof HttpGenerator)
  5. {
  6. HttpGenerator generator = (HttpGenerator)g;
  7. String expect = _connection.getRequest().getHeader(HttpHeaders.EXPECT);
  8. if (expect!=null && expect.startsWith("102") && generator.getVersion()>=HttpVersions.HTTP_1_1_ORDINAL)
  9. {
  10. boolean was_persistent=generator.isPersistent();
  11. generator.setResponse(HttpStatus.ORDINAL_102_Processing,null);
  12. generator.completeHeader(null,true);
  13. generator.setPersistent(true);
  14. generator.complete();
  15. generator.flush();
  16. generator.reset(false);
  17. generator.setPersistent(was_persistent);
  18. }
  19. }
  20. }

相关文章