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