Search in sources :

Example 1 with ValidationBinder

use of org.glassfish.jersey.server.validation.internal.ValidationBinder in project jersey by jersey.

the class ValidationFeature method configure.

@Override
public boolean configure(final FeatureContext context) {
    final Configuration config = context.getConfiguration();
    // Validation disabled?
    if (PropertiesHelper.isProperty(config.getProperty(ServerProperties.BV_FEATURE_DISABLE))) {
        return false;
    }
    context.register(new ValidationBinder());
    // when ServerProperties.BV_SEND_ERROR_IN_RESPONSE is enabled.
    if (PropertiesHelper.isProperty(config.getProperty(ServerProperties.BV_SEND_ERROR_IN_RESPONSE)) && config.getProperty(ServerProperties.RESPONSE_SET_STATUS_OVER_SEND_ERROR) == null) {
        context.property(ServerProperties.RESPONSE_SET_STATUS_OVER_SEND_ERROR, true);
    }
    return true;
}
Also used : ValidationBinder(org.glassfish.jersey.server.validation.internal.ValidationBinder) Configuration(javax.ws.rs.core.Configuration)

Aggregations

Configuration (javax.ws.rs.core.Configuration)1 ValidationBinder (org.glassfish.jersey.server.validation.internal.ValidationBinder)1