Package org.springframework.web.servlet.resource

Examples of org.springframework.web.servlet.resource.GzipResourceResolver


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // For examples using Spring 4.1.0
        if ((env.getProperty("resource.handler.conf")).equals("4.1.0")) {
            registry.addResourceHandler("/js/**").addResourceLocations("/js/").setCachePeriod(3600).resourceChain(true).addResolver(new GzipResourceResolver()).addResolver(new PathResourceResolver());
            registry.addResourceHandler("/resources/**").addResourceLocations("/resources/", "classpath:/other-resources/").setCachePeriod(3600).resourceChain(true).addResolver(new PathResourceResolver());
            registry.addResourceHandler("/files/**").addResourceLocations("file:/Users/Elena/").setCachePeriod(3600).resourceChain(true).addResolver(new PathResourceResolver());
            registry.addResourceHandler("/other-files/**").addResourceLocations("file:/Users/Elena/").setCachePeriod(3600).resourceChain(true).addResolver(new GzipResourceResolver());
        }
        // For examples using Spring 4.0.7
        else if ((env.getProperty("resource.handler.conf")).equals("4.0.7")) {
            registry.addResourceHandler("/resources/**").addResourceLocations("/", "/resources/", "classpath:/other-resources/");
            registry.addResourceHandler("/files/**").addResourceLocations("file:/Users/Elena/");
 
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.resource.GzipResourceResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.