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


Java CachingHttpHeadersFilter类代码示例

本文整理汇总了Java中io.github.jhipster.web.filter.CachingHttpHeadersFilter的典型用法代码示例。如果您正苦于以下问题:Java CachingHttpHeadersFilter类的具体用法?Java CachingHttpHeadersFilter怎么用?Java CachingHttpHeadersFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CachingHttpHeadersFilter类属于io.github.jhipster.web.filter包,在下文中一共展示了CachingHttpHeadersFilter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initCachingHttpHeadersFilter

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
/**
 * Initializes the caching HTTP Headers Filter.
 */
private void initCachingHttpHeadersFilter(ServletContext servletContext,
                                          EnumSet<DispatcherType> disps) {
    log.debug("Registering Caching HTTP Headers Filter");
    FilterRegistration.Dynamic cachingHttpHeadersFilter =
        servletContext.addFilter("cachingHttpHeadersFilter",
            new CachingHttpHeadersFilter(jHipsterProperties));

    cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*");
    cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*");
    cachingHttpHeadersFilter.setAsyncSupported(true);
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:15,代码来源:WebConfigurer.java

示例2: testStartUpProdServletContext

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
@Test
public void testStartUpProdServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
    verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:13,代码来源:WebConfigurerTest.java

示例3: testStartUpDevServletContext

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
@Test
public void testStartUpDevServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
    verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class));
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:13,代码来源:WebConfigurerTest.java

示例4: initCachingHttpHeadersFilter

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
/**
 * Initializes the caching HTTP Headers Filter.
 */
private void initCachingHttpHeadersFilter(ServletContext servletContext,
                                          EnumSet<DispatcherType> disps) {
	log.debug("Registering Caching HTTP Headers Filter");
	FilterRegistration.Dynamic cachingHttpHeadersFilter =
		servletContext.addFilter("cachingHttpHeadersFilter",
			new CachingHttpHeadersFilter(jHipsterProperties));

	cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*");
	cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*");
	cachingHttpHeadersFilter.setAsyncSupported(true);
}
 
开发者ID:alikemalocalan,项目名称:MicroBlog,代码行数:15,代码来源:WebConfigurer.java

示例5: testStartUpProdServletContext

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
@Test
public void testStartUpProdServletContext() throws ServletException {
	env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
	webConfigurer.onStartup(servletContext);

	assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
	assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
	verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
	verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
	verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
}
 
开发者ID:alikemalocalan,项目名称:MicroBlog,代码行数:12,代码来源:WebConfigurerTest.java

示例6: testStartUpDevServletContext

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
@Test
public void testStartUpDevServletContext() throws ServletException {
	env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
	webConfigurer.onStartup(servletContext);

	assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
	assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
	verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
	verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
	verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
}
 
开发者ID:alikemalocalan,项目名称:MicroBlog,代码行数:12,代码来源:WebConfigurerTest.java

示例7: testStartUpProdServletContext

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
@Test
public void testStartUpProdServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
}
 
开发者ID:kalnee,项目名称:trivor,代码行数:12,代码来源:WebConfigurerTest.java

示例8: testStartUpDevServletContext

import io.github.jhipster.web.filter.CachingHttpHeadersFilter; //导入依赖的package包/类
@Test
public void testStartUpDevServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
}
 
开发者ID:kalnee,项目名称:trivor,代码行数:12,代码来源:WebConfigurerTest.java


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