本文整理汇总了Java中org.jboss.resteasy.plugins.interceptors.CorsFilter类的典型用法代码示例。如果您正苦于以下问题:Java CorsFilter类的具体用法?Java CorsFilter怎么用?Java CorsFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CorsFilter类属于org.jboss.resteasy.plugins.interceptors包,在下文中一共展示了CorsFilter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CelebinoApplication
import org.jboss.resteasy.plugins.interceptors.CorsFilter; //导入依赖的package包/类
public CelebinoApplication() {
// Multiple client-request: Cross-Filter
CorsFilter filter = new CorsFilter();
filter.getAllowedOrigins().add("*");
filter.setAllowedMethods("POST, GET, DELETE, PUT, OPTIONS");
filter.setAllowedHeaders("Content-Type, Authorization");
this.singletons.add(filter);
// Controllers dispon�veis no servi�o.
this.singletons.add(new UserController());
this.singletons.add(new GardenController());
this.singletons.add(new GardenStatusController());
this.singletons.add(new WateringController());
this.singletons.add(new AirConditioningController());
this.singletons.add(new LitersMinuteController());
}
开发者ID:mrh3nry,项目名称:Celebino,代码行数:19,代码来源:CelebinoApplication.java
示例2: IFOpenDoorsApplication
import org.jboss.resteasy.plugins.interceptors.CorsFilter; //导入依赖的package包/类
public IFOpenDoorsApplication() {
CorsFilter filter = new CorsFilter();
filter.getAllowedOrigins().add("*");
filter.setAllowedMethods("POST, GET, DELETE, PUT, OPTIONS");
filter.setAllowedHeaders("Content-Type, Authorization");
this.singletons.add(filter);
// Controllers das entidades.
this.singletons.add(new RoomController());
this.singletons.add(new PersonController());
this.singletons.add(new DoorController());
this.singletons.add(new TypeRoomController());
this.singletons.add(new GateController());
this.singletons.add(new RoleController());
// Mapeamento do index e servi�os.
this.singletons.add(new IFOpenDoorsRestServices());
this.singletons.add(new IFOpenDoorsIndex());
}
开发者ID:LADOSSIFPB,项目名称:-gdgjp-HackGDGIO2015-IFOpenDoors,代码行数:22,代码来源:IFOpenDoorsApplication.java
示例3: WebApplication
import org.jboss.resteasy.plugins.interceptors.CorsFilter; //导入依赖的package包/类
public WebApplication(@Context Dispatcher dispatcher) {
singletons.add(new HivdbVersionService());
singletons.add(new GraphQLService());
classes.add(SequenceAnalysisService.class);
CorsFilter corsFilter = new CorsFilter();
corsFilter.getAllowedOrigins().add("*");
singletons.add(corsFilter);
}
开发者ID:hivdb,项目名称:sierra,代码行数:9,代码来源:WebApplication.java
示例4: getCorsFilter
import org.jboss.resteasy.plugins.interceptors.CorsFilter; //导入依赖的package包/类
static CorsFilter getCorsFilter(JaxRSCoreConfig config) {
CorsFilter corsFilter = new CorsFilter();
corsFilter.setAllowCredentials(config.allowCredentials());
corsFilter.setAllowedMethods(config.allowedMethods());
corsFilter.setCorsMaxAge(config.corsMaxAge());
corsFilter.setAllowedHeaders(Arrays.stream(config.allowedHeaders())
.collect(Collectors.joining(DELIMITER_COMMA)));
corsFilter.setExposedHeaders(Arrays.stream(config.exposedHeaders())
.collect(Collectors.joining(DELIMITER_COMMA)));
corsFilter.getAllowedOrigins().addAll(Arrays.stream(config.allowedOrigins())
.collect(Collectors.toSet()));
return corsFilter;
}
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:14,代码来源:JaxRSUtil.java
示例5: configure
import org.jboss.resteasy.plugins.interceptors.CorsFilter; //导入依赖的package包/类
@Override
public boolean configure(@Nonnull final FeatureContext featureContext) {
// Add the appropriate CORS header.
final CorsFilter corsFilter = new CorsFilter();
corsFilter.getAllowedOrigins().add("*");
featureContext.register(corsFilter);
return true;
}
开发者ID:tomtom-international,项目名称:configuration-service,代码行数:10,代码来源:CorsFeature.java
示例6: configure
import org.jboss.resteasy.plugins.interceptors.CorsFilter; //导入依赖的package包/类
@Override
public boolean configure(@Nonnull final FeatureContext context) {
// Add the appropriate CORS header.
final CorsFilter corsFilter = new CorsFilter();
corsFilter.getAllowedOrigins().add("*");
context.register(corsFilter);
return true;
}
开发者ID:tomtom-international,项目名称:speedtools,代码行数:10,代码来源:CorsFeature.java
示例7: NdexRestApi
import org.jboss.resteasy.plugins.interceptors.CorsFilter; //导入依赖的package包/类
public NdexRestApi() throws NdexException
{
_resources.add(GroupService.class);
_resources.add(GroupServiceV2.class);
_resources.add(UserService.class);
_resources.add(UserServiceV2.class);
// _resources.add(RequestService.class);
_resources.add(RequestServiceV2.class);
_resources.add(TaskService.class);
_resources.add(TaskServiceV2.class);
_resources.add(NetworkService.class);
_resources.add(NetworkServiceV2.class);
_resources.add(AdminService.class);
_resources.add(AdminServiceV2.class);
_resources.add(BatchServiceV2.class);
_resources.add(SearchServiceV2.class);
_resources.add(NetworkSetServiceV2.class);
_providers.add(new BasicAuthenticationFilter());
_providers.add(new NdexDefaultResponseFilter());
_providers.add(new DuplicateObjectExceptionMapper());
_providers.add(new NdexExceptionMapper());
_providers.add(new ObjectNotFoundExceptionMapper());
_providers.add(new UnauthorizedOperationExceptionMapper());
_providers.add(new ForbiddenExceptionMapper());
_providers.add(new BadRequestExceptionMapper());
_providers.add(new DefaultExceptionMapper());
_providers.add(new NdexPreZippedInterceptor());
CorsFilter corsFilter = new CorsFilter();
corsFilter.getAllowedOrigins().add("*");
corsFilter.setAllowCredentials(true);
_providers.add( corsFilter);
}
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:35,代码来源:NdexRestApi.java
注:本文中的org.jboss.resteasy.plugins.interceptors.CorsFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论