當前位置: 首頁>>代碼示例>>Java>>正文


Java Connector.setRedirectPort方法代碼示例

本文整理匯總了Java中org.apache.catalina.connector.Connector.setRedirectPort方法的典型用法代碼示例。如果您正苦於以下問題:Java Connector.setRedirectPort方法的具體用法?Java Connector.setRedirectPort怎麽用?Java Connector.setRedirectPort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.catalina.connector.Connector的用法示例。


在下文中一共展示了Connector.setRedirectPort方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: httpConnector

import org.apache.catalina.connector.Connector; //導入方法依賴的package包/類
public Connector httpConnector() {
	Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
	connector.setScheme("http");
	// Connector監聽的http的端口號
	connector.setPort(80);
	connector.setSecure(false);
	// 監聽到http的端口號後轉向到的https的端口號
	connector.setRedirectPort(8443);
	return connector;
}
 
開發者ID:514840279,項目名稱:danyuan-application,代碼行數:11,代碼來源:App.java

示例2: initiateHttpConnector

import org.apache.catalina.connector.Connector; //導入方法依賴的package包/類
private Connector initiateHttpConnector() {
    Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
    connector.setScheme("http");
    connector.setPort(8080);
    connector.setSecure(false);
    connector.setRedirectPort(8443);

    return connector;
}
 
開發者ID:Clcanny,項目名稱:MicroServiceDemo,代碼行數:10,代碼來源:WebMvcConfig.java

示例3: configureAjp

import org.apache.catalina.connector.Connector; //導入方法依賴的package包/類
private void configureAjp(final TomcatEmbeddedServletContainerFactory tomcat) {
    final CasServerProperties.Ajp ajp = casProperties.getServer().getAjp();
    if (ajp.isEnabled() && ajp.getPort() > 0) {
        LOGGER.debug("Creating AJP configuration for the embedded tomcat container...");
        final Connector ajpConnector = new Connector(ajp.getProtocol());
        ajpConnector.setProtocol(ajp.getProtocol());
        ajpConnector.setPort(ajp.getPort());
        ajpConnector.setSecure(ajp.isSecure());
        ajpConnector.setAllowTrace(ajp.isAllowTrace());
        ajpConnector.setScheme(ajp.getScheme());
        if (ajp.getAsyncTimeout() > 0) {
            ajpConnector.setAsyncTimeout(ajp.getAsyncTimeout());
        }
        ajpConnector.setEnableLookups(ajp.isEnableLookups());
        if (ajp.getMaxPostSize() > 0) {
            ajpConnector.setMaxPostSize(ajp.getMaxPostSize());
        }
        ajpConnector.addUpgradeProtocol(new Http2Protocol());

        if (ajp.getProxyPort() > 0) {
            LOGGER.debug("Set AJP proxy port to [{}]", ajp.getProxyPort());
            ajpConnector.setProxyPort(ajp.getProxyPort());
        }

        if (ajp.getRedirectPort() > 0) {
            LOGGER.debug("Set AJP redirect port to [{}]", ajp.getRedirectPort());
            ajpConnector.setRedirectPort(ajp.getRedirectPort());
        }

        ajp.getAttributes().forEach(ajpConnector::setAttribute);

        tomcat.addAdditionalTomcatConnectors(ajpConnector);
    }
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:35,代碼來源:CasEmbeddedContainerTomcatConfiguration.java


注:本文中的org.apache.catalina.connector.Connector.setRedirectPort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。