当前位置: 首页>>代码示例>>Java>>正文


Java WebContentInterceptor类代码示例

本文整理汇总了Java中org.springframework.web.servlet.mvc.WebContentInterceptor的典型用法代码示例。如果您正苦于以下问题:Java WebContentInterceptor类的具体用法?Java WebContentInterceptor怎么用?Java WebContentInterceptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WebContentInterceptor类属于org.springframework.web.servlet.mvc包,在下文中一共展示了WebContentInterceptor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addInterceptors

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {

    //
    // レスポンスのキャッシュを制御する Interceptor
    //
    val interceptor = new WebContentInterceptor();
    interceptor.setCacheSeconds(0);
    interceptor.setUseExpiresHeader(true);
    interceptor.setUseCacheControlHeader(true);
    interceptor.setUseCacheControlNoStore(true);
    val cacheMappings = new Properties();
    // cache for one month
    cacheMappings.put("/assets/**", "2592000"); // TODO
                                                // local環境だけキャッシュしないとか分岐が必要
    cacheMappings.put("/webjars/**", "2592000");
    interceptor.setCacheMappings(cacheMappings);
    registry.addInterceptor(interceptor);
}
 
开发者ID:chibat,项目名称:j2ts,代码行数:20,代码来源:Config.java

示例2: addInterceptors

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Override
protected void addInterceptors(InterceptorRegistry registry) {
	WebContentInterceptor interceptor = new WebContentInterceptor();
	interceptor.setUseCacheControlNoStore(false);
	interceptor.setUseCacheControlHeader(false);

	//You can add interceptors here
	//CommonInterceptor common = new CommonInterceptor();
	//registry.addInterceptor(common);
}
 
开发者ID:vitallan,项目名称:BasicSpringMVC,代码行数:11,代码来源:WebConfig.java

示例3: webContentInterceptor

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Bean
public WebContentInterceptor webContentInterceptor() {
    final WebContentInterceptor interceptor = new WebContentInterceptor();
    interceptor.setCacheSeconds(0);
    interceptor.setAlwaysUseFullPath(true);
    return interceptor;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:8,代码来源:CasSecurityContextConfiguration.java

示例4: addInterceptors

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
/**
 * 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
 */
@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);
}
 
开发者ID:bonitasoft,项目名称:bonita-ui-designer,代码行数:17,代码来源:WebMvcConfiguration.java

示例5: initWebContentInterceptor

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Bean
WebContentInterceptor initWebContentInterceptor() {
    WebContentInterceptor webContentInterceptor = new WebContentInterceptor();
    webContentInterceptor.setCacheSeconds(0);
    webContentInterceptor.setUseCacheControlHeader(true);
    return webContentInterceptor;
}
 
开发者ID:sercxtyf,项目名称:onboard,代码行数:8,代码来源:WebConfig.java

示例6: addInterceptors

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    WebContentInterceptor webContentInterceptor = new WebContentInterceptor();
    webContentInterceptor.setCacheSeconds(0);
    webContentInterceptor.setUseExpiresHeader(true);
    webContentInterceptor.setUseCacheControlHeader(true);
    webContentInterceptor.setUseCacheControlNoStore(true);
    registry.addInterceptor(new WebContentInterceptor());
}
 
开发者ID:adobe-research,项目名称:cross-preferences,代码行数:10,代码来源:Config.java

示例7: webContentInterceptor

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
public @Bean WebContentInterceptor webContentInterceptor () {
	if (this.webContentInterceptor == null) {
		this.webContentInterceptor = new WebContentInterceptor ();
	
		this.webContentInterceptor.setAlwaysUseFullPath (true);
		this.webContentInterceptor.setCacheSeconds (0);
		
		this.webContentInterceptor.setCacheMappings (new Properties () {
			private static final long serialVersionUID = 1L;
			
			{
				put ("/styles/**", "86400");
				put ("/scripts/**", "86400");
				put ("/images/**", "86400");
			}
		});
	}
	
	return this.webContentInterceptor;
}
 
开发者ID:CDS-INSPIRE,项目名称:InSpider,代码行数:21,代码来源:AdminWebMvcConfig.java

示例8: addInterceptors

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    WebContentInterceptor webContentInterceptor = new WebContentInterceptor();
    Properties cacheMappings = new Properties();
    cacheMappings.setProperty(UrlSchema.API + "/**", "0");
    webContentInterceptor.setCacheMappings(cacheMappings);
    registry.addInterceptor(webContentInterceptor);
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:9,代码来源:Application.java

示例9: addInterceptors

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
  WebContentInterceptor interceptor = new WebContentInterceptor();
  interceptor.addCacheMapping(CacheControl.maxAge(365, TimeUnit.DAYS), "/**");
  registry.addInterceptor(interceptor);
}
 
开发者ID:janweinschenker,项目名称:servlet4-demo,代码行数:7,代码来源:ApplicationConfig.java

示例10: testAddInterceptors

import org.springframework.web.servlet.mvc.WebContentInterceptor; //导入依赖的package包/类
@Test
public void testAddInterceptors() {
  sut.addInterceptors(registry);
  verify(registry, times(1)).addInterceptor(any(WebContentInterceptor.class));
}
 
开发者ID:janweinschenker,项目名称:servlet4-demo,代码行数:6,代码来源:ApplicationConfigTest.java


注:本文中的org.springframework.web.servlet.mvc.WebContentInterceptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。