Java 类org.glassfish.jersey.server.validation.ValidationFeature 实例源码

项目:Graphene    文件:GrapheneRESTServer.java   
static ResourceConfig generateResourceConfig(Config config, Graphene graphene) {
    ResourceConfig rc = new ResourceConfig();

    // settings
    rc.property(ServerProperties.FEATURE_AUTO_DISCOVERY_DISABLE, true);
    rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true); // TODO: remove in production

    // basic features
    rc.register(CORSFilter.class);
    rc.register(JacksonFeature.class);
    rc.register(ValidationFeature.class);

    // custom resources
    GrapheneResourceFactory factory = new GrapheneResourceFactory(config, graphene);

    rc.register(factory.createResource(AdminResource.class));
    rc.register(factory.createResource(CoreferenceResource.class));
    rc.register(factory.createResource(RelationExtractionResource.class));

    return rc;
}
项目:git-webapp    文件:ApiConfig.java   
@Inject
public ApiConfig(ServiceLocator serviceLocator) {
  register(JacksonFeature.class);
  register(ValidationFeature.class);
  property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, "true");

  register(AuthenticationRequestFilter.class);
  register(AdminNecessaryRequestFilter.class);
  register(RepositoryControllRequestFilter.class);

  register(HttpCacheControlFilter.class);

  register(ApiForbiddenExceptionMapper.class);
  register(ApiNotFoundExceptionMapper.class);
  register(ApiLoginRequiredExceptionMapper.class);
  register(AjaxValidationErrorExceptionMapper.class);
  register(PostErrorResponseFilter.class);

  GuiceBridge.getGuiceBridge().initializeGuiceBridge(serviceLocator);
  GuiceIntoHK2Bridge guiceBridge = serviceLocator.getService(GuiceIntoHK2Bridge.class);
  guiceBridge.bridgeGuiceInjector(GuiceListener.get());

  packages(false, this.getClass().getPackage() + ".rs");
}
项目:git-webapp    文件:AppConfig.java   
@Inject
public AppConfig(ServiceLocator serviceLocator) {
  register(FreemarkerMvcFeature.class);
  property(FreemarkerMvcFeature.TEMPLATES_BASE_PATH, "/WEB-INF/templates");
  property(FreemarkerMvcFeature.TEMPLATE_OBJECT_FACTORY, FlexibleConfiguration.class);

  register(AttachContextInterceptor.class);
  register(ValidationFeature.class);
  property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, "true");

  register(AuthenticationRequestFilter.class);
  register(AdminNecessaryRequestFilter.class);
  register(RepositoryControllRequestFilter.class);
  register(HtmlLoginRequiredExceptionMapper.class);

  register(HttpCacheControlFilter.class);

  GuiceBridge.getGuiceBridge().initializeGuiceBridge(serviceLocator);
  GuiceIntoHK2Bridge guiceBridge = serviceLocator.getService(GuiceIntoHK2Bridge.class);
  guiceBridge.bridgeGuiceInjector(GuiceListener.get());

  packages(false, this.getClass().getPackage() + ".html");
}
项目:Template-Jersey_Rest    文件:JerseyConfig.java   
public JerseyConfig() {
    register(ValidationFeature.class);
    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

    // Swagger listing resources
    register(io.swagger.jaxrs.listing.ApiListingResource.class);
    register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
}
项目:ViTA    文件:BaseApplication.java   
public BaseApplication() {
    packages(true, SERVICES_PACKAGE);
    packages(true, DAO_PACKAGE);
    packages(true, ANALYSIS_PACKAGE);
    register(MultiPartFeature.class);
    register(ValidationFeature.class);
    register(DocumentsService.class);
}
项目:maven-framework-project    文件:CoffeeApplication.java   
@Override
public Set<Class<?>> getClasses() {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(CoffeesResource.class);
    classes.add(ValidationFeature.class);
    return classes;
}
项目:maven-framework-project    文件:CoffeeApplication.java   
@Override
public Set<Class<?>> getClasses() {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(CoffeesResource.class);
    classes.add(ValidationFeature.class);
    return classes;
}
项目:rest-utils    文件:Application.java   
/**
 * Register server features
 * @param config The config to register the features with
 * @param restConfig The application's configuration
 */
protected void registerFeatures(Configurable<?> config, T restConfig) {
  config.register(ValidationFeature.class);
}