Java 类org.springframework.web.servlet.config.annotation.ResourceChainRegistration 实例源码

项目:smarti    文件:StaticWebResourceConfiguration.java   
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/index.html")
            .addResourceLocations("classpath:/public/", "classpath:/static/")
            .setCacheControl(createCacheConfig(maxIndexCacheAge))
            .resourceChain(true)
            .addResolver(new PathResourceResolver());

    final ResourceChainRegistration registration = registry.addResourceHandler("/**")
            .addResourceLocations("classpath:/public/", "classpath:/static/",
                    "classpath:/META-INF/resources/")
            .setCacheControl(createCacheConfig(maxCacheAge))
            .resourceChain(true)
            .addResolver(new PathResourceResolver());

    if (propertyInjectionTransformer != null) {
        registration.addTransformer(propertyInjectionTransformer);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcAutoConfiguration.java   
private void configureResourceChain(ResourceProperties.Chain properties,
        ResourceChainRegistration chain) {
    Strategy strategy = properties.getStrategy();
    if (strategy.getFixed().isEnabled() || strategy.getContent().isEnabled()) {
        chain.addResolver(getVersionResourceResolver(strategy));
    }
    if (properties.isGzipped()) {
        chain.addResolver(new GzipResourceResolver());
    }
    if (properties.isHtmlApplicationCache()) {
        chain.addTransformer(new AppCacheManifestTransformer());
    }
}
项目:spring-boot-concourse    文件:WebMvcAutoConfiguration.java   
private void configureResourceChain(ResourceProperties.Chain properties,
        ResourceChainRegistration chain) {
    Strategy strategy = properties.getStrategy();
    if (strategy.getFixed().isEnabled() || strategy.getContent().isEnabled()) {
        chain.addResolver(getVersionResourceResolver(strategy));
    }
    if (properties.isGzipped()) {
        chain.addResolver(new GzipResourceResolver());
    }
    if (properties.isHtmlApplicationCache()) {
        chain.addTransformer(new AppCacheManifestTransformer());
    }
}
项目:contestparser    文件:WebMvcAutoConfiguration.java   
private void configureResourceChain(ResourceProperties.Chain properties,
        ResourceChainRegistration chain) {
    Strategy strategy = properties.getStrategy();
    if (strategy.getFixed().isEnabled() || strategy.getContent().isEnabled()) {
        chain.addResolver(getVersionResourceResolver(strategy));
    }
    if (properties.isHtmlApplicationCache()) {
        chain.addTransformer(new AppCacheManifestTransformer());
    }
}