當前位置: 首頁>>代碼示例>>Java>>正文


Java CorsConfiguration.getAllowedOrigins方法代碼示例

本文整理匯總了Java中org.springframework.web.cors.CorsConfiguration.getAllowedOrigins方法的典型用法代碼示例。如果您正苦於以下問題:Java CorsConfiguration.getAllowedOrigins方法的具體用法?Java CorsConfiguration.getAllowedOrigins怎麽用?Java CorsConfiguration.getAllowedOrigins使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.web.cors.CorsConfiguration的用法示例。


在下文中一共展示了CorsConfiguration.getAllowedOrigins方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        log.debug("Registering CORS filter");
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:12,代碼來源:WebConfigurer.java

示例2: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        log.debug("Registering CORS filter");
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
        source.registerCorsConfiguration("/*/api/**", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:IBM,項目名稱:Microservices-with-JHipster-and-Spring-Boot,代碼行數:13,代碼來源:WebConfigurer.java

示例3: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = new CorsConfiguration();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins()
        .isEmpty()) {
        log.debug("Registering CORS filter");
        source.registerCorsConfiguration("/api/**", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:megadotnet,項目名稱:SpringBootDemoApp,代碼行數:12,代碼來源:WebConfigurer.java

示例4: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        log.debug("Registering CORS filter");
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
        source.registerCorsConfiguration("/*/api/**", config);
        source.registerCorsConfiguration("/*/oauth/**", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:xm-online,項目名稱:xm-gate,代碼行數:14,代碼來源:WebConfigurer.java

示例5: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        log.debug("Registering CORS filter");
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/management/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:torgcrm,項目名稱:TorgCRM-Server,代碼行數:13,代碼來源:WebConfigurer.java

示例6: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        log.debug("Registering CORS filter");
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
        source.registerCorsConfiguration("/oauth/**", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:SGKhmCs,項目名稱:speakTogether,代碼行數:13,代碼來源:WebConfigurer.java

示例7: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = props.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
        source.registerCorsConfiguration("/oauth/**", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:ugouku,項目名稱:shoucang,代碼行數:12,代碼來源:WebConfigurer.java

示例8: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = props.getCors();
   
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
        source.registerCorsConfiguration("/oauth/**", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:jbernach,項目名稱:transandalus-backend,代碼行數:13,代碼來源:WebConfigurer.java

示例9: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
        source.registerCorsConfiguration("/oauth/**", config);
    }
    return new CorsFilter(source);
}
 
開發者ID:xetys,項目名稱:jhipster-ribbon-hystrix,代碼行數:12,代碼來源:WebConfigurer.java

示例10: corsFilter

import org.springframework.web.cors.CorsConfiguration; //導入方法依賴的package包/類
@Bean
public CorsFilter corsFilter() {
	UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
	CorsConfiguration config = jHipsterProperties.getCors();
	if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
		log.debug("Registering CORS filter");
		source.registerCorsConfiguration("/api/**", config);
		source.registerCorsConfiguration("/v2/api-docs", config);
	}
	return new CorsFilter(source);
}
 
開發者ID:alikemalocalan,項目名稱:MicroBlog,代碼行數:12,代碼來源:WebConfigurer.java


注:本文中的org.springframework.web.cors.CorsConfiguration.getAllowedOrigins方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。