Search in sources :

Example 1 with ResourceRegionHttpMessageConverter

use of org.springframework.http.converter.ResourceRegionHttpMessageConverter in project spring-framework by spring-projects.

the class ResourceHttpRequestHandler method afterPropertiesSet.

@Override
public void afterPropertiesSet() throws Exception {
    if (logger.isWarnEnabled() && CollectionUtils.isEmpty(this.locations)) {
        logger.warn("Locations list is empty. No resources will be served unless a " + "custom ResourceResolver is configured as an alternative to PathResourceResolver.");
    }
    if (this.resourceResolvers.isEmpty()) {
        this.resourceResolvers.add(new PathResourceResolver());
    }
    initAllowedLocations();
    if (this.resourceHttpMessageConverter == null) {
        this.resourceHttpMessageConverter = new ResourceHttpMessageConverter();
    }
    if (this.resourceRegionHttpMessageConverter == null) {
        this.resourceRegionHttpMessageConverter = new ResourceRegionHttpMessageConverter();
    }
    this.contentNegotiationStrategy = initContentNegotiationStrategy();
}
Also used : ResourceRegionHttpMessageConverter(org.springframework.http.converter.ResourceRegionHttpMessageConverter) ResourceHttpMessageConverter(org.springframework.http.converter.ResourceHttpMessageConverter)

Aggregations

ResourceHttpMessageConverter (org.springframework.http.converter.ResourceHttpMessageConverter)1 ResourceRegionHttpMessageConverter (org.springframework.http.converter.ResourceRegionHttpMessageConverter)1