当前位置: 首页>>代码示例>>Java>>正文


Java GZIPContentEncodingFilter类代码示例

本文整理汇总了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

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<String, String> params = new HashMap<String, String>();
    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,代码来源:WebApp.java

示例2: CCOWContextListener

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.<Module> builder().add(behaviourModules).add(new EndpointModule(commonContext))
			.add(new JerseyServletModule() {

				@Override
				protected void configureServlets() {
					final Map<String, String> params = ImmutableMap.<String, String> 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,代码来源:CCOWContextListener.java

示例3: configureServlets

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<String, String> params = new HashMap<String, String>();
  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,代码来源:SliderAMWebApp.java

示例4: configureServlets

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<String, String> params = new HashMap<String, String>();
    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,代码来源:WebApp.java

示例5: configureServlets

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<String> responseFilters = Arrays.asList(
        EncodingJerseyResponseFilter.class.getName(),
        GZIPContentEncodingFilter.class.getName()
    );
    Map<String, String> 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,代码来源:PreferanserServletContextListener.java

示例6: responseFilters

import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //导入依赖的package包/类
protected ImmutableList<Class<? extends ContainerResponseFilter>> responseFilters() {
    return ImmutableList.of(CachingFilter.class,
                            PaginationFilter.class,
                            GZIPContentEncodingFilter.class);
}
 
开发者ID:enviroCar,项目名称:enviroCar-server,代码行数:6,代码来源:JerseyModule.java

示例7: requestFilters

import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter; //导入依赖的package包/类
protected ImmutableList<Class<? extends ContainerRequestFilter>> requestFilters() {
    return ImmutableList.of(GZIPContentEncodingFilter.class,
                            URIContentNegotiationFilter.class,
                            AuthenticationFilter.class);
}
 
开发者ID:enviroCar,项目名称:enviroCar-server,代码行数:6,代码来源:JerseyModule.java


注:本文中的com.sun.jersey.api.container.filter.GZIPContentEncodingFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。