本文整理匯總了Java中org.eclipse.jetty.server.HttpConfiguration.setSendXPoweredBy方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpConfiguration.setSendXPoweredBy方法的具體用法?Java HttpConfiguration.setSendXPoweredBy怎麽用?Java HttpConfiguration.setSendXPoweredBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jetty.server.HttpConfiguration
的用法示例。
在下文中一共展示了HttpConfiguration.setSendXPoweredBy方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateJettyHttpConfiguration
import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConfiguration generateJettyHttpConfiguration( ConnectorConfiguration theConfiguration ) {
HttpConfiguration httpConfiguration = new HttpConfiguration();
if( theConfiguration.getHeaderCacheSize( ) != null ) {
httpConfiguration.setHeaderCacheSize( theConfiguration.getHeaderCacheSize( ) );
}
if( theConfiguration.getRequestHeaderSize( ) != null ) {
httpConfiguration.setRequestHeaderSize( theConfiguration.getRequestHeaderSize( ) );
}
if( theConfiguration.getResponseHeaderSize( ) != null ) {
httpConfiguration.setResponseHeaderSize( theConfiguration.getResponseHeaderSize( ) );
}
if( theConfiguration.getOutputBufferSize( ) != null ) {
httpConfiguration.setOutputBufferSize( theConfiguration.getOutputBufferSize( ) );
}
httpConfiguration.setSendDateHeader( false ); // TODO: verify if I should manually do this, and in what way this sets it (UTC, local, etc)
httpConfiguration.setSendServerVersion( false );
httpConfiguration.setSendXPoweredBy( false );
return httpConfiguration;
}
示例2: createConfiguration
import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
/**
* Creates a Jetty HTTP configuration.
*
* @return A Jetty HTTP configuration.
*/
private HttpConfiguration createConfiguration()
{
final HttpConfiguration configuration = new HttpConfiguration();
configuration.setHeaderCacheSize( getHttpHeaderCacheSize() );
configuration.setRequestHeaderSize( getHttpRequestHeaderSize() );
configuration.setResponseHeaderSize( getHttpResponseHeaderSize() );
configuration.setOutputBufferSize( getHttpOutputBufferSize() );
configuration.setDelayDispatchUntilContent( getHttpDelayDispatchUntilContent() );
configuration.setOutputAggregationSize( getHttpOutputAggregationSize() );
configuration.setPersistentConnectionsEnabled( getHttpPersistentConnectionsEnabled() );
configuration.setSendDateHeader( getHttpSendDateHeader() );
configuration.setSendServerVersion( getHttpSendVersionHeader() );
configuration.setSendXPoweredBy( getHttpSendXPoweredBy() );
return configuration;
}
示例3: get
import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
@Override
public HttpConfiguration get() {
HttpConfiguration configuration = new HttpConfiguration();
configuration.setSendXPoweredBy(false);
configuration.setSendServerVersion(false);
return configuration;
}
示例4: newHttpConnectionFactory
import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private HttpConnectionFactory newHttpConnectionFactory() {
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setSendDateHeader(true);
httpConfig.setSendServerVersion(false);
httpConfig.setSendXPoweredBy(false);
httpConfig.setHeaderCacheSize(connectorConfig.headerCacheSize());
httpConfig.setOutputBufferSize(connectorConfig.outputBufferSize());
httpConfig.setRequestHeaderSize(connectorConfig.requestHeaderSize());
httpConfig.setResponseHeaderSize(connectorConfig.responseHeaderSize());
if (connectorConfig.ssl().enabled()) {
httpConfig.addCustomizer(new SecureRequestCustomizer());
}
return new HttpConnectionFactory(httpConfig);
}
示例5: createHttpConfiguration
import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
private static HttpConfiguration createHttpConfiguration() {
HttpConfiguration config = new HttpConfiguration();
config.setSecureScheme("https");
config.setSecurePort(SSL_PORT);
config.setSendXPoweredBy(false);
config.setSendServerVersion(false);
config.addCustomizer(new SecureRequestCustomizer());
return config;
}
示例6: prepare
import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
/**
* A fully configured Jetty Server instance
*/
public void prepare() throws Exception {
// === jetty.xml ===
// Setup Threadpool
QueuedThreadPool threadPool = new QueuedThreadPool();
threadPool.setMinThreads(MIN_THREADS);
threadPool.setMaxThreads(MAX_THREADS);
// Server
server = new Server(threadPool);
// Scheduler
server.addBean(new ScheduledExecutorScheduler());
// HTTP Configuration
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setSecureScheme(HttpScheme.HTTPS.asString());
httpConfig.setSecurePort(CONFIG.getJetty().getHttpsPort());
httpConfig.setOutputBufferSize(32768);
httpConfig.setRequestHeaderSize(8192);
httpConfig.setResponseHeaderSize(8192);
httpConfig.setSendServerVersion(false);
httpConfig.setSendDateHeader(false);
httpConfig.setSendXPoweredBy(false);
// Extra options
server.setDumpAfterStart(false);
server.setDumpBeforeStop(false);
server.setStopAtShutdown(true);
server.setStopTimeout(STOP_TIMEOUT);
if (CONFIG.getJetty().isHttpEnabled()) {
server.addConnector(httpConnector(httpConfig));
}
if (CONFIG.getJetty().isHttpsEnabled()) {
server.addConnector(httpsConnector(httpConfig));
}
SteveAppContext steveAppContext = new SteveAppContext();
server.setHandler(steveAppContext.getHandlers());
}