@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching .setCachePeriod(0)//Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/").resourceChain(true); // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/").resourceChain(true); } registry.addResourceHandler("/**") .addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**") .addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); } }
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching .setCachePeriod(0)//Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { // css resource registry .addResourceHandler("/css/**") .addResourceLocations("classpath:/static/css/"); // js resource registry .addResourceHandler("/js/**") .addResourceLocations("classpath:/static/js/"); // js resource registry .addResourceHandler("/vendors/**") .addResourceLocations("classpath:/static/vendors/"); // img resource registry .addResourceHandler("/img/**") .addResourceLocations("classpath:/static/img/"); }
@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); } }
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry .addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(3600) .resourceChain(true) .addResolver(new PathResourceResolver()); }
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry .addResourceHandler("/css/**") .addResourceLocations("/js/") .setCachePeriod(31556926); }
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry .addResourceHandler("/css/**") .addResourceLocations("/js/**") .setCachePeriod(31556926); }
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { int cachePeriodInSeconds = (int) TimeUnit.DAYS.toSeconds(1); if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/") .setCachePeriod(cachePeriodInSeconds); } }