Example usage for org.springframework.web.servlet.mvc WebContentInterceptor WebContentInterceptor

List of usage examples for org.springframework.web.servlet.mvc WebContentInterceptor WebContentInterceptor

Introduction

In this page you can find the example usage for org.springframework.web.servlet.mvc WebContentInterceptor WebContentInterceptor.

Prototype

public WebContentInterceptor() 

Source Link

Usage

From source file:org.wallride.autoconfigure.WebAdminConfiguration.java

@Override
public void addInterceptors(InterceptorRegistry registry) {
    WebContentInterceptor webContentInterceptor = new WebContentInterceptor();
    webContentInterceptor.setCacheSeconds(0);
    webContentInterceptor.setUseExpiresHeader(true);
    webContentInterceptor.setUseCacheControlHeader(true);
    webContentInterceptor.setUseCacheControlNoStore(true);
    registry.addInterceptor(webContentInterceptor);

    registry.addInterceptor(defaultModelAttributeInterceptor);
    registry.addInterceptor(setupRedirectInterceptor);
}

From source file:org.bonitasoft.web.designer.config.WebMvcConfiguration.java

/**
 * In Internet Explorer http requests are cached by default. It's a problem when we want to provide a REST API. This interceptor
 * adds headers in the responses to desactivate the cache. NB :  static resources are cached but managed by the resource handlers
 *
 * @param registry//from  w ww .ja  v a2  s  .c o m
 */
@Override
public void addInterceptors(InterceptorRegistry registry) {
    WebContentInterceptor interceptor = new WebContentInterceptor();
    interceptor.setCacheSeconds(0);
    interceptor.setUseExpiresHeader(true);
    interceptor.setUseCacheControlHeader(true);
    interceptor.setUseCacheControlNoStore(true);

    registry.addInterceptor(interceptor);
}