本文整理匯總了Java中org.eclipse.jetty.server.HttpConfiguration.setHeaderCacheSize方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpConfiguration.setHeaderCacheSize方法的具體用法?Java HttpConfiguration.setHeaderCacheSize怎麽用?Java HttpConfiguration.setHeaderCacheSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jetty.server.HttpConfiguration
的用法示例。
在下文中一共展示了HttpConfiguration.setHeaderCacheSize方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildHttpConfiguration
import org.eclipse.jetty.server.HttpConfiguration; //導入方法依賴的package包/類
protected HttpConfiguration buildHttpConfiguration() {
HttpConfiguration httpConfig = new HttpConfiguration();
// most parameters are hardcoded for now... we should turn these
// into properties
httpConfig.setHeaderCacheSize(512);
httpConfig.setOutputBufferSize(32 * 1024);
httpConfig.setRequestHeaderSize(requestHeaderSize);
httpConfig.setResponseHeaderSize(responseHeaderSize);
httpConfig.setSendDateHeader(true);
httpConfig.setSendServerVersion(true);
httpConfig.addCustomizer(new ForwardedRequestCustomizer());
return httpConfig;
}
示例2: 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;
}
示例3: 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;
}
示例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);
}