本文整理匯總了Java中com.sun.jersey.api.container.filter.GZIPContentEncodingFilter類的典型用法代碼示例。如果您正苦於以下問題:Java GZIPContentEncodingFilter類的具體用法?Java GZIPContentEncodingFilter怎麽用?Java GZIPContentEncodingFilter使用的例子?那麽恭喜您, 這裏精選的類代碼示例或許可以為您提供幫助。
GZIPContentEncodingFilter類屬於com.sun.jersey.api.container.filter包,在下文中一共展示了GZIPContentEncodingFilter類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: configureWebAppServlets
點讚 3
import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //導入依賴的package包/類
protected void configureWebAppServlets() {
// Add in the web services filters/serves if app has them.
// Using Jersey/guice integration module. If user has web services
// they must have also bound a default one in their webapp code.
if (this.wsName != null) {
// There seems to be an issue with the guice/jersey integration
// where we have to list the stuff we don't want it to serve
// through the guicecontainer. In this case its everything except
// the the web services api prefix. We can't just change the filter
// from /* below - that doesn't work.
String regex = "(?!/" + this.wsName + ")";
serveRegex(regex).with(DefaultWrapperServlet.class);
Map params = new HashMap();
params.put(ResourceConfig.FEATURE_IMPLICIT_VIEWABLES, "true");
params.put(ServletContainer.FEATURE_FILTER_FORWARD_ON_404, "true");
params.put(FeaturesAndProperties.FEATURE_XMLROOTELEMENT_PROCESSING, "true");
params.put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, GZIPContentEncodingFilter.class.getName());
params.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, GZIPContentEncodingFilter.class.getName());
filter("/*").through(getWebAppFilterClass(), params);
}
}
開發者ID:naver,項目名稱:hadoop,代碼行數:23,
示例2: CCOWContextListener
點讚 3
import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //導入依賴的package包/類
public CCOWContextListener(final ContextState commonContext, final Module... behaviourModules) {
super();
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
logger.info("Starting up servlet ...");
this.modules = ImmutableList. builder().add(behaviourModules).add(new EndpointModule(commonContext))
.add(new JerseyServletModule() {
@Override
protected void configureServlets() {
final Map params = ImmutableMap. builder()
.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS,
GZIPContentEncodingFilter.class.getName())
.build();
bind(CORSFilter.class).in(Singleton.class);
bind(UrlRewriteFilter.class).in(Singleton.class);
serve("/*").with(GuiceContainer.class, params);
filter("/*").through(CORSFilter.class);
filter("/*").through(UrlRewriteFilter.class);
requestStaticInjection(WebSocketsConfigurator.class);
}
}).build();
}
開發者ID:jkiddo,項目名稱:ccow,代碼行數:25,
示例3: configureServlets
點讚 3
import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //導入依賴的package包/類
@Override
public void configureServlets() {
setup();
serve("/", "/__stop").with(Dispatcher.class);
for (String path : this.getServePathSpecs()) {
serve(path).with(Dispatcher.class);
}
String regex = "(?!/ws)";
serveRegex(regex).with(SliderDefaultWrapperServlet.class);
Map params = new HashMap();
params.put(ResourceConfig.FEATURE_IMPLICIT_VIEWABLES, "true");
params.put(ServletContainer.FEATURE_FILTER_FORWARD_ON_404, "true");
params.put(ResourceConfig.FEATURE_XMLROOTELEMENT_PROCESSING, "true");
params.put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, GZIPContentEncodingFilter.class.getName());
params.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, GZIPContentEncodingFilter.class.getName());
//params.put("com.sun.jersey.spi.container.ContainerRequestFilters", "com.sun.jersey.api.container.filter.LoggingFilter");
//params.put("com.sun.jersey.spi.container.ContainerResponseFilters", "com.sun.jersey.api.container.filter.LoggingFilter");
//params.put("com.sun.jersey.config.feature.Trace", "true");
params.put("com.sun.jersey.config.property.WadlGeneratorConfig",
AMWadlGeneratorConfig.CLASSNAME);
filter("/*").through(GuiceContainer.class, params);
}
開發者ID:apache,項目名稱:incubator-slider,代碼行數:27,
示例4: configureServlets
點讚 2
import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //導入依賴的package包/類
@Override
public void configureServlets() {
setup();
serve("/", "/__stop").with(Dispatcher.class);
for (String path : this.servePathSpecs) {
serve(path).with(Dispatcher.class);
}
// Add in the web services filters/serves if app has them.
// Using Jersey/guice integration module. If user has web services
// they must have also bound a default one in their webapp code.
if (this.wsName != null) {
// There seems to be an issue with the guice/jersey integration
// where we have to list the stuff we don't want it to serve
// through the guicecontainer. In this case its everything except
// the the web services api prefix. We can't just change the filter
// from /* below - that doesn't work.
String regex = "(?!/" + this.wsName + ")";
serveRegex(regex).with(DefaultWrapperServlet.class);
Map params = new HashMap();
params.put(ResourceConfig.FEATURE_IMPLICIT_VIEWABLES, "true");
params.put(ServletContainer.FEATURE_FILTER_FORWARD_ON_404, "true");
params.put(FeaturesAndProperties.FEATURE_XMLROOTELEMENT_PROCESSING, "true");
params.put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, GZIPContentEncodingFilter.class.getName());
params.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, GZIPContentEncodingFilter.class.getName());
filter("/*").through(GuiceContainer.class, params);
}
}
開發者ID:ict-carch,項目名稱:hadoop-plus,代碼行數:33,
示例5: configureServlets
點讚 2
import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //導入依賴的package包/類
@Override protected void configureServlets() {
bind(GuiceContainer.class);
bind(JacksonJsonProvider.class).toProvider(JacksonJsonProviderProvider.class).in(Scopes.SINGLETON);
List responseFilters = Arrays.asList(
EncodingJerseyResponseFilter.class.getName(),
GZIPContentEncodingFilter.class.getName()
);
Map params = ImmutableMap.of(
WebComponent.RESOURCE_CONFIG_CLASS, JerseyResourceConfig.class.getName(),
PackagesResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, Joiner.on(",").join(responseFilters)
);
serve("/Preferanser/*").with(GuiceContainer.class, params);
}
開發者ID:Unisay,項目名稱:preferanser,代碼行數:14,
示例6: responseFilters
點讚 2
import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //導入依賴的package包/類
protected ImmutableList> responseFilters() {
return ImmutableList.of(CachingFilter.class,
PaginationFilter.class,
GZIPContentEncodingFilter.class);
}
開發者ID:enviroCar,項目名稱:enviroCar-server,代碼行數:6,
示例7: requestFilters
點讚 2
import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //導入依賴的package包/類
protected ImmutableList> requestFilters() {
return ImmutableList.of(GZIPContentEncodingFilter.class,
URIContentNegotiationFilter.class,
AuthenticationFilter.class);
}
開發者ID:enviroCar,項目名稱:enviroCar-server,代碼行數:6,
注:本文中的com.sun.jersey.api.container.filter.GZIPContentEncodingFilter類示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。