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


Java InterceptorRegistry.addInterceptor方法代码示例

本文整理汇总了Java中org.springframework.web.servlet.config.annotation.InterceptorRegistry.addInterceptor方法的典型用法代码示例。如果您正苦于以下问题:Java InterceptorRegistry.addInterceptor方法的具体用法?Java InterceptorRegistry.addInterceptor怎么用?Java InterceptorRegistry.addInterceptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.web.servlet.config.annotation.InterceptorRegistry的用法示例。


在下文中一共展示了InterceptorRegistry.addInterceptor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: baseConfigurerBean

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Bean
	public WebMvcConfigurerAdapter baseConfigurerBean(@Named final ScooldRequestInterceptor sri) {
		return new WebMvcConfigurerAdapter() {
			@Override
			public void addInterceptors(InterceptorRegistry registry) {
				super.addInterceptors(registry);
				registry.addInterceptor(sri);
			}

//			@Override
//			public void addResourceHandlers(ResourceHandlerRegistry registry) {
//				registry.addResourceHandler("/images/**").addResourceLocations("/static/images/")
//					.setCacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic());
//				registry.addResourceHandler("/styles/**").addResourceLocations("/static/styles/")
//					.setCacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic());
//				registry.addResourceHandler("/scripts/**").addResourceLocations("/static/scripts/")
//					.setCacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic());
//			}
		};
	}
 
开发者ID:Erudika,项目名称:scoold,代码行数:21,代码来源:ScooldServer.java

示例2: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
/**
 * 添加令牌处理拦截器,检查请求头是否带有效的令牌。
 */
@Override
public void addInterceptors(InterceptorRegistry registry) {
    InterceptorRegistration interceptor = registry.addInterceptor(tokenInterceptor);

    String pathPatterns = devcloudProperties.getPathPatterns();
    log.info("Interceptor path patterns: " + pathPatterns);

    if (pathPatterns == null || pathPatterns.isEmpty()) {
        return;
    }

    String[] paths = pathPatterns.split(",");
    if (paths == null || paths.length == 0) {
        return;
    }

    for (String path : paths) {
        interceptor.addPathPatterns(path);
    }
}
 
开发者ID:kenly333,项目名称:service-hive,代码行数:24,代码来源:DevCloudWebMvcConfigurer.java

示例3: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(final InterceptorRegistry registry) {
    registry.addInterceptor(localeChangeInterceptor());
    registry.addInterceptor(casManagementSecurityInterceptor())
            .addPathPatterns("/**").excludePathPatterns("/callback*", "/logout*", "/authorizationFailure");
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:7,代码来源:CasManagementWebAppConfiguration.java

示例4: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(localeChangeInterceptor());
}
 
开发者ID:JUGIstanbul,项目名称:second-opinion-api,代码行数:5,代码来源:LocalizationConfiguration.java

示例5: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new TracingHandlerInterceptor(tracer, spanDecorators));
}
 
开发者ID:opentracing-contrib,项目名称:java-spring-web,代码行数:5,代码来源:SpringBootConfiguration.java

示例6: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
    localeChangeInterceptor.setParamName("language");
    registry.addInterceptor(localeChangeInterceptor);
}
 
开发者ID:mraible,项目名称:devoxxus-jhipster-microservices-demo,代码行数:7,代码来源:LocaleConfiguration.java

示例7: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {// ②
	registry.addInterceptor(demoInterceptor());
}
 
开发者ID:longjiazuo,项目名称:springMvc4.x-project,代码行数:5,代码来源:MyMvcConfig.java

示例8: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(authorizationInterceptor);
}
 
开发者ID:aollio,项目名称:school-express-delivery,代码行数:5,代码来源:WebMvcConfig.java

示例9: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的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: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(localeInterceptor());
}
 
开发者ID:remipassmoilesel,项目名称:simple-hostel-management,代码行数:5,代码来源:SpringConfiguration.java

示例11: addInterceptors

import org.springframework.web.servlet.config.annotation.InterceptorRegistry; //导入方法依赖的package包/类
@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(timelineInterceptor);
}
 
开发者ID:xm-online,项目名称:xm-commons,代码行数:5,代码来源:TimelineConfig.java


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