當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。