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

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

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

Request.setServerPort介绍

暂无

代码示例

代码示例来源:origin: line/armeria

  1. try {
  2. final int port = Integer.parseInt(hostHeader.substring(colonPos + 1));
  3. coyoteReq.setServerPort(port);
  4. } catch (NumberFormatException e) {

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

代码示例来源:origin: org.osivia.portal.core/osivia-portal-jbossas-jbossweb-lib

  1. /* */ public void setServerPort(int port)
  2. /* */ {
  3. /* 862 */ this.coyoteRequest.setServerPort(port);
  4. /* */ }
  5. /* */

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * Set the port number of the server to process this request.
  3. *
  4. * @param port The server port
  5. */
  6. public void setServerPort(int port) {
  7. coyoteRequest.setServerPort(port);
  8. }

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

  1. /**
  2. * {@inheritDoc}
  3. * <p>
  4. * This implementation provides the server name from the default host and
  5. * the server port from the local port.
  6. */
  7. @Override
  8. protected void populateHost() {
  9. // No host information (HTTP/1.0)
  10. // Ensure the local port field is populated before using it.
  11. request.action(ActionCode.REQ_LOCALPORT_ATTRIBUTE, request);
  12. request.setServerPort(request.getLocalPort());
  13. // request.serverName() will be set to the default host name by the
  14. // mapper
  15. }

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

  1. request.setServerPort(socket.getLocalPort());
  2. InetAddress localAddress = socket.getLocalAddress();
  3. if (sslSupport == null) {
  4. request.setServerPort(80);
  5. } else {
  6. request.setServerPort(443);
  7. mult = 10 * mult;
  8. request.setServerPort(port);

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

  1. /**
  2. * {@inheritDoc}
  3. * <p>
  4. * This implementation populates the server name and port from the local
  5. * name and port provided by the AJP message.
  6. */
  7. @Override
  8. protected void populateHost() {
  9. // No host information (HTTP/1.0)
  10. request.setServerPort(request.getLocalPort());
  11. try {
  12. request.serverName().duplicate(request.localName());
  13. } catch (IOException e) {
  14. response.setStatus(400);
  15. setErrorState(ErrorState.CLOSE_CLEAN, e);
  16. }
  17. }

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

  1. request.setServerPort(request.getLocalPort());
  2. try {
  3. request.serverName().duplicate(request.localName());
  4. if (request.scheme().equalsIgnoreCase("https")) {
  5. request.setServerPort(443);
  6. } else {
  7. request.setServerPort(80);
  8. mult = 10 * mult;
  9. request.setServerPort(port);

代码示例来源:origin: org.glassfish.metro/webservices-extra

  1. request.setServerPort(selectorThread.getPort());

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

  1. private void setHost(final Request request, final CharSequence host) throws IOException {
  2. CharChunk chunk;
  3. try {
  4. // slightly fancier logic..
  5. final URL newUrl = new URL(host.toString());
  6. final String protocol = newUrl.getProtocol();
  7. final int port = newUrl.getPort();
  8. final String newHost = newUrl.getHost();
  9. request.getCoyoteRequest().serverName().recycle();
  10. chunk = request.getCoyoteRequest().serverName().getCharChunk();
  11. chunk.recycle();
  12. chunk.append(newHost);
  13. request.getCoyoteRequest().serverName().toChars();
  14. request.getCoyoteRequest().setServerPort(port);
  15. request.getCoyoteRequest().scheme().recycle();
  16. chunk = request.getCoyoteRequest().scheme().getCharChunk();
  17. chunk.recycle();
  18. chunk.append(protocol);
  19. request.getCoyoteRequest().scheme().toChars();
  20. } catch (final MalformedURLException e) {
  21. // assume we just have the host name
  22. request.getCoyoteRequest().serverName().recycle();
  23. chunk = request.getCoyoteRequest().serverName().getCharChunk();
  24. chunk.recycle();
  25. chunk.append(host.toString());
  26. request.getCoyoteRequest().serverName().toChars();
  27. }
  28. }

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

  1. request.setServerPort(port);

相关文章

Request类方法