org.apache.coyote.Request.getAttribute()方法的使用及代码示例

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

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

Request.getAttribute介绍

暂无

代码示例

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

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute("org.apache.tomcat.sendfile.filename");
  4. if (fileName != null) {
  5. // No entity body sent here
  6. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  7. contentDelimitation = true;
  8. sendfileData = new NioEndpoint.SendfileData();
  9. sendfileData.fileName = fileName;
  10. sendfileData.pos = ((Long) request.getAttribute("org.apache.tomcat.sendfile.start")).longValue();
  11. sendfileData.length = ((Long) request.getAttribute("org.apache.tomcat.sendfile.end")).longValue() - sendfileData.pos;
  12. return true;
  13. }
  14. return false;
  15. }

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

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute("org.apache.tomcat.sendfile.filename");
  4. if (fileName != null) {
  5. // No entity body sent here
  6. outputBuffer.addActiveFilter
  7. (outputFilters[Constants.VOID_FILTER]);
  8. contentDelimitation = true;
  9. sendfileData = new AprEndpoint.SendfileData();
  10. sendfileData.fileName = fileName;
  11. sendfileData.start =
  12. ((Long) request.getAttribute("org.apache.tomcat.sendfile.start")).longValue();
  13. sendfileData.end =
  14. ((Long) request.getAttribute("org.apache.tomcat.sendfile.end")).longValue();
  15. return true;
  16. }
  17. return false;
  18. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. private void prepareSendfile(OutputFilter[] outputFilters) {
  2. String fileName = (String) request.getAttribute(
  3. org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR);
  4. if (fileName == null) {
  5. sendfileData = null;
  6. } else {
  7. // No entity body sent here
  8. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  9. contentDelimitation = true;
  10. long pos = ((Long) request.getAttribute(
  11. org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue();
  12. long end = ((Long) request.getAttribute(
  13. org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue();
  14. sendfileData = socketWrapper.createSendfileData(fileName, pos, end - pos);
  15. }
  16. }

代码示例来源:origin: codefollower/Tomcat-Research

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute(
  4. org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR);
  5. if (fileName != null) {
  6. // No entity body sent here
  7. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  8. contentDelimitation = true;
  9. sendfileData = new NioEndpoint.SendfileData();
  10. sendfileData.fileName = fileName;
  11. sendfileData.pos = ((Long) request.getAttribute(
  12. org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue();
  13. sendfileData.length = ((Long) request.getAttribute(
  14. org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue() - sendfileData.pos;
  15. return true;
  16. }
  17. return false;
  18. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. /**
  2. * Obtain the remote address for this connection as reported by an
  3. * intermediate proxy (if any).
  4. *
  5. * @return The remote address for the this connection
  6. */
  7. public String getRemoteAddrForwarded() {
  8. String remoteAddrProxy = (String) req.getAttribute(Constants.REMOTE_ADDR_ATTRIBUTE);
  9. if (remoteAddrProxy == null) {
  10. return getRemoteAddr();
  11. }
  12. return remoteAddrProxy;
  13. }

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute(
  4. org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR);
  5. if (fileName != null) {
  6. // No entity body sent here
  7. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  8. contentDelimitation = true;
  9. sendfileData = new NioEndpoint.SendfileData();
  10. sendfileData.fileName = fileName;
  11. sendfileData.pos = ((Long) request.getAttribute(
  12. org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue();
  13. sendfileData.length = ((Long) request.getAttribute(
  14. org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue() - sendfileData.pos;
  15. return true;
  16. }
  17. return false;
  18. }

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute(
  4. "org.apache.tomcat.sendfile.filename");
  5. if (fileName != null) {
  6. // No entity body sent here
  7. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  8. contentDelimitation = true;
  9. sendfileData = new AprEndpoint.SendfileData();
  10. sendfileData.fileName = fileName;
  11. sendfileData.start = ((Long) request.getAttribute(
  12. "org.apache.tomcat.sendfile.start")).longValue();
  13. sendfileData.end = ((Long) request.getAttribute(
  14. "org.apache.tomcat.sendfile.end")).longValue();
  15. return true;
  16. }
  17. return false;
  18. }

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute(
  4. "org.apache.tomcat.sendfile.filename");
  5. if (fileName != null) {
  6. // No entity body sent here
  7. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  8. contentDelimitation = true;
  9. sendfileData = new NioEndpoint.SendfileData();
  10. sendfileData.fileName = fileName;
  11. sendfileData.pos = ((Long) request.getAttribute(
  12. "org.apache.tomcat.sendfile.start")).longValue();
  13. sendfileData.length = ((Long) request.getAttribute(
  14. "org.apache.tomcat.sendfile.end")).longValue() - sendfileData.pos;
  15. return true;
  16. }
  17. return false;
  18. }

代码示例来源:origin: codefollower/Tomcat-Research

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute(
  4. org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR);
  5. if (fileName != null) {
  6. // No entity body sent here
  7. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  8. contentDelimitation = true;
  9. sendfileData = new AprEndpoint.SendfileData();
  10. sendfileData.fileName = fileName;
  11. sendfileData.start = ((Long) request.getAttribute(
  12. org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue();
  13. sendfileData.end = ((Long) request.getAttribute(
  14. org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue();
  15. return true;
  16. }
  17. return false;
  18. }

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

  1. @Override
  2. protected boolean prepareSendfile(OutputFilter[] outputFilters) {
  3. String fileName = (String) request.getAttribute(
  4. org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR);
  5. if (fileName != null) {
  6. // No entity body sent here
  7. outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
  8. contentDelimitation = true;
  9. sendfileData = new AprEndpoint.SendfileData();
  10. sendfileData.fileName = fileName;
  11. sendfileData.start = ((Long) request.getAttribute(
  12. org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue();
  13. sendfileData.end = ((Long) request.getAttribute(
  14. org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue();
  15. return true;
  16. }
  17. return false;
  18. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. private void prepareSendfile() {
  2. String fileName = (String) stream.getCoyoteRequest().getAttribute(
  3. org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR);
  4. if (fileName != null) {
  5. sendfileData = new SendfileData();
  6. sendfileData.path = new File(fileName).toPath();
  7. sendfileData.pos = ((Long) stream.getCoyoteRequest().getAttribute(
  8. org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue();
  9. sendfileData.end = ((Long) stream.getCoyoteRequest().getAttribute(
  10. org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue();
  11. sendfileData.left = sendfileData.end - sendfileData.pos;
  12. sendfileData.stream = stream;
  13. }
  14. }

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

  1. attr = coyoteRequest.getAttribute(name);
  2. if (attr != null) {
  3. return attr;
  4. attr = coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
  5. if (attr != null) {
  6. attributes.put(Globals.CERTIFICATES_ATTR, attr);
  7. attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
  8. if (attr != null) {
  9. attributes.put(Globals.CIPHER_SUITE_ATTR, attr);
  10. attr = coyoteRequest.getAttribute(Globals.KEY_SIZE_ATTR);
  11. if (attr != null) {
  12. attributes.put(Globals.KEY_SIZE_ATTR, attr);
  13. attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_ID_ATTR);
  14. if (attr != null) {
  15. attributes.put(Globals.SSL_SESSION_ID_ATTR, attr);
  16. attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_MGR_ATTR);
  17. if (attr != null) {
  18. attributes.put(Globals.SSL_SESSION_MGR_ATTR, attr);
  19. attr = coyoteRequest.getAttribute(SSLSupport.PROTOCOL_VERSION_KEY);
  20. if (attr != null) {
  21. attributes.put(SSLSupport.PROTOCOL_VERSION_KEY, attr);

代码示例来源:origin: org.jboss.web/jbossweb

  1. public X509Certificate[] getCertificateChain() {
  2. X509Certificate certs[] = (X509Certificate[]) getAttribute(Globals.CERTIFICATES_ATTR);
  3. if ((certs == null) || (certs.length < 1)) {
  4. coyoteRequest.action(ActionCode.ACTION_REQ_SSL_CERTIFICATE,
  5. coyoteRequest);
  6. certs = (X509Certificate[]) coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
  7. if (certs != null) {
  8. attributes.put(Globals.CERTIFICATES_ATTR, certs);
  9. }
  10. }
  11. return certs;
  12. }

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

  1. attr = coyoteRequest.getAttribute(name);
  2. if(attr != null) {
  3. return attr;
  4. coyoteRequest.action(ActionCode.REQ_SSL_ATTRIBUTE,
  5. coyoteRequest);
  6. attr = coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
  7. if( attr != null) {
  8. attributes.put(Globals.CERTIFICATES_ATTR, attr);
  9. attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
  10. if(attr != null) {
  11. attributes.put(Globals.CIPHER_SUITE_ATTR, attr);
  12. attr = coyoteRequest.getAttribute(Globals.KEY_SIZE_ATTR);
  13. if(attr != null) {
  14. attributes.put(Globals.KEY_SIZE_ATTR, attr);
  15. attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_ID_ATTR);
  16. if(attr != null) {
  17. attributes.put(Globals.SSL_SESSION_ID_ATTR, attr);
  18. attributes.put(Globals.SSL_SESSION_ID_TOMCAT_ATTR, attr);
  19. attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_MGR_ATTR);
  20. if(attr != null) {
  21. attributes.put(Globals.SSL_SESSION_MGR_ATTR, attr);

代码示例来源:origin: jboss.web/jbossweb

  1. return(attr);
  2. attr = coyoteRequest.getAttribute(name);
  3. if(attr != null)
  4. return attr;
  5. coyoteRequest.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
  6. coyoteRequest);
  7. attr = coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
  8. if( attr != null) {
  9. attributes.put(Globals.CERTIFICATES_ATTR, attr);
  10. attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
  11. if(attr != null) {
  12. attributes.put(Globals.CIPHER_SUITE_ATTR, attr);
  13. attr = coyoteRequest.getAttribute(Globals.KEY_SIZE_ATTR);
  14. if(attr != null) {
  15. attributes.put(Globals.KEY_SIZE_ATTR, attr);
  16. attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_ID_ATTR);
  17. if(attr != null) {
  18. attributes.put(Globals.SSL_SESSION_ID_ATTR, attr);

代码示例来源:origin: org.jboss.web/jbossweb

  1. return(attr);
  2. attr = coyoteRequest.getAttribute(name);
  3. if(attr != null)
  4. return attr;
  5. coyoteRequest.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
  6. coyoteRequest);
  7. attr = coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
  8. if( attr != null) {
  9. attributes.put(Globals.CERTIFICATES_ATTR, attr);
  10. attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
  11. if(attr != null) {
  12. attributes.put(Globals.CIPHER_SUITE_ATTR, attr);
  13. attr = coyoteRequest.getAttribute(Globals.KEY_SIZE_ATTR);
  14. if(attr != null) {
  15. attributes.put(Globals.KEY_SIZE_ATTR, attr);
  16. attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_ID_ATTR);
  17. if(attr != null) {
  18. attributes.put(Globals.SSL_SESSION_ID_ATTR, attr);

代码示例来源:origin: tomcat/catalina

  1. return(attr);
  2. attr = coyoteRequest.getAttribute(name);
  3. if(attr != null)
  4. return attr;
  5. coyoteRequest.action(ActionCode.ACTION_REQ_SSL_ATTRIBUTE,
  6. coyoteRequest);
  7. attr = coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
  8. if( attr != null) {
  9. attributes.put(Globals.CERTIFICATES_ATTR, attr);
  10. attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
  11. if(attr != null) {
  12. attributes.put(Globals.CIPHER_SUITE_ATTR, attr);
  13. attr = coyoteRequest.getAttribute(Globals.KEY_SIZE_ATTR);
  14. if(attr != null) {
  15. attributes.put(Globals.KEY_SIZE_ATTR, attr);
  16. attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_ID_ATTR);
  17. if(attr != null) {
  18. attributes.put(Globals.SSL_SESSION_ID_ATTR, attr);

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

  1. @Override
  2. protected void setCometTimeouts(SocketWrapper<NioChannel> socketWrapper) {
  3. // Comet support
  4. SelectionKey key = socketWrapper.getSocket().getIOChannel().keyFor(
  5. socketWrapper.getSocket().getPoller().getSelector());
  6. if (key != null) {
  7. NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) key.attachment();
  8. if (attach != null) {
  9. attach.setComet(comet);
  10. if (comet) {
  11. Integer comettimeout = (Integer) request.getAttribute("org.apache.tomcat.comet.timeout");
  12. if (comettimeout != null) {
  13. attach.setTimeout(comettimeout.longValue());
  14. }
  15. }
  16. }
  17. }
  18. }

代码示例来源:origin: codefollower/Tomcat-Research

  1. @Override
  2. protected void setCometTimeouts(SocketWrapper<NioChannel> socketWrapper) {
  3. // Comet support
  4. SelectionKey key = socketWrapper.getSocket().getIOChannel().keyFor(
  5. socketWrapper.getSocket().getPoller().getSelector());
  6. if (key != null) {
  7. NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) key.attachment();
  8. if (attach != null) {
  9. attach.setComet(comet);
  10. if (comet) {
  11. Integer comettimeout = (Integer) request.getAttribute(
  12. org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
  13. if (comettimeout != null) {
  14. attach.setTimeout(comettimeout.longValue());
  15. }
  16. }
  17. }
  18. }
  19. }

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

  1. @Override
  2. protected void setCometTimeouts(SocketWrapper<NioChannel> socketWrapper) {
  3. // Comet support
  4. SelectionKey key = socketWrapper.getSocket().getIOChannel().keyFor(
  5. socketWrapper.getSocket().getPoller().getSelector());
  6. if (key != null) {
  7. NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) key.attachment();
  8. if (attach != null) {
  9. attach.setComet(comet);
  10. if (comet) {
  11. Integer comettimeout = (Integer) request.getAttribute(
  12. org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
  13. if (comettimeout != null) {
  14. attach.setTimeout(comettimeout.longValue());
  15. }
  16. }
  17. }
  18. }
  19. }

相关文章

Request类方法