@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); } }
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()); } }
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()); } }