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


Java CorsRegistry.addMapping方法代码示例

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


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

示例1: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Bean
public WebMvcConfigurer corsConfigurer()
{
	return new WebMvcConfigurerAdapter() {
		@Override
		public void addCorsMappings(CorsRegistry registry)
		{
			registry.addMapping("/swagger/swagger-spec.yaml");
			if (yonaProperties.getSecurity().isCorsAllowed())
			{
				// Enable CORS for the other resources, to allow testing the API through Swagger UI.
				registry.addMapping("/**").allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE");
			}
		}
	};
}
 
开发者ID:yonadev,项目名称:yona-server,代码行数:17,代码来源:AppServiceApplication.java

示例2: addCorsMappings

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Override
public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/api/v1/**");
}
 
开发者ID:cuiods,项目名称:WIFIProbe,代码行数:5,代码来源:WebMvcConfig.java

示例3: webMvcConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Bean
@Conditional(Development.class)
public WebMvcConfigurer webMvcConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addCorsMappings(final CorsRegistry registry) {
            registry.addMapping("/**");
        }
    };
}
 
开发者ID:backpaper0,项目名称:spring-boot-vue-simple-sample,代码行数:11,代码来源:DemoApplication.java

示例4: addCorsMappings

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**");
//                .allowedOrigins("http://domain2.com")
//                .allowedMethods("PUT", "DELETE")
//                .allowedHeaders("header1", "header2", "header3")
//                .exposedHeaders("header1", "header2")
//                .allowCredentials(false).maxAge(3600);
    }
 
开发者ID:sdcuike,项目名称:spring-boot-oauth2-demo,代码行数:10,代码来源:MvcConfig.java

示例5: addCorsMappings

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Override
public void addCorsMappings(final CorsRegistry registry)
{
	// FIXME: for now we enable CORS for the whole REST API
	// registry.addMapping(ENDPOINT_ROOT + "/**");

	// NOTE: this seems to not work (i.e. headers are not added), so:
	// pls check de.metas.ui.web.config.CORSFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
	// because we are setting the headers there... and that works!

	registry.addMapping("/**");
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:13,代码来源:WebConfig.java

示例6: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Bean
@ConditionalOnProperty(value = "graphql.server.corsEnabled", havingValue = "true", matchIfMissing = true)
public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping(graphQLServerMapping);
        }
    };
}
 
开发者ID:oembedler,项目名称:graphql-spring-boot,代码行数:11,代码来源:GraphQLWebAutoConfiguration.java

示例7: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Bean
public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/services/**");
            registry.addMapping("*/*");
            registry.addMapping("/**");
            registry.addMapping("/**/**");
        }
    };
}
 
开发者ID:shairontoledo,项目名称:cloudstatus,代码行数:13,代码来源:Application.java

示例8: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
/**
 * Global enable CORS for all mappings /api/**
 *
 * @return
 */
@Bean
public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/api/**");
        }
    };
}
 
开发者ID:IIDP,项目名称:OSTMap,代码行数:15,代码来源:MainController.java

示例9: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
/**
 * Enables CORS globally.
 *
 * @return A {@link WebMvcConfigurer} instance with default CORS configuration - allow everything.
 */
@Bean
public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/**");
        }
    };
}
 
开发者ID:yahoo,项目名称:bullet-service,代码行数:15,代码来源:APIConfiguration.java

示例10: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Bean
public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/api/**");
        }
    };
}
 
开发者ID:EMBL-EBI-SUBS-OLD,项目名称:subs,代码行数:10,代码来源:CORSConfiguration.java

示例11: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Bean
public WebMvcConfigurer corsConfigurer() {
  return new WebMvcConfigurerAdapter() {
    @Override
    public void addCorsMappings(final CorsRegistry registry) {
      registry.addMapping("/**");
    }
  };
}
 
开发者ID:holisticon,项目名称:camunda-bpm-cloud,代码行数:10,代码来源:WorkloadQueryServiceApplication.java

示例12: corsConfigurer

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Bean
public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/**");
        }
    };
}
 
开发者ID:ClouDesire,项目名称:janine,代码行数:10,代码来源:WebConfiguration.java

示例13: addCorsMappings

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Override
public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/**/*");
}
 
开发者ID:BBVA,项目名称:mirrorgate,代码行数:5,代码来源:WebMvcConfigurerAdapterImpl.java

示例14: addCorsMappings

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Override
public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/**");
}
 
开发者ID:Eagle-OJ,项目名称:eagle-oj-api,代码行数:5,代码来源:WebMvcConfigurer.java

示例15: addCorsMappings

import org.springframework.web.servlet.config.annotation.CorsRegistry; //导入方法依赖的package包/类
@Override
public void addCorsMappings(CorsRegistry registry) {
    registry
        .addMapping("/**");
}
 
开发者ID:BakkerTom,项目名称:happy-news,代码行数:6,代码来源:WebMvcConfig.java


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