本文整理汇总了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());
}