Package org.springframework.web.servlet.resource

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


  }

  protected List<ResourceResolver> getResourceResolvers() {
    if (!this.hasPathResolver) {
      List<ResourceResolver> result = new ArrayList<ResourceResolver>(this.resolvers);
      result.add(new PathResourceResolver());
      return result;
    }
    return this.resolvers;
  }
View Full Code Here


  @Test
  public void resourceChainWithOverrides() throws Exception {
    CachingResourceResolver cachingResolver = Mockito.mock(CachingResourceResolver.class);
    VersionResourceResolver versionResolver = Mockito.mock(VersionResourceResolver.class);
    PathResourceResolver pathResourceResolver = new PathResourceResolver();
    CachingResourceTransformer cachingTransformer = Mockito.mock(CachingResourceTransformer.class);
    AppCacheManifestTransformer appCacheTransformer = Mockito.mock(AppCacheManifestTransformer.class);
    CssLinkResourceTransformer cssLinkTransformer = new CssLinkResourceTransformer();

    this.registration.setCachePeriod(3600)
View Full Code Here

    @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/");
View Full Code Here

TOP

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

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.