Skip to content

Instantly share code, notes, and snippets.

@emmanuelbernard
Last active December 14, 2015 21:18
Show Gist options
  • Save emmanuelbernard/2191bad0c7d8742a8eea to your computer and use it in GitHub Desktop.
Save emmanuelbernard/2191bad0c7d8742a8eea to your computer and use it in GitHub Desktop.
<!-- APPROACH #1 -->
<?xml version="1.0" encoding="UTF-8"?>
<validation-config
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"
version="1.1">
<default-provider>com.acme.ACMEProvider</default-provider>
<message-interpolator>com.acme.ACMEAwareMessageInterpolator</message-interpolator>
<!-- when present disable executable validation -->
<disable-executable-validation/> <!-- or should it be <disable-validation-on-execution/> -->
<!-- default-validated-executables is ignored if disable-executable-validation is present -->
<default-validated-executables>
<executable-type>NONE</executable-type>
</default-validated-executables>
<constraint-mapping>META-INF/validation/order-constraints.xml</constraint-mapping>
<constraint-mapping>META-INF/validation/catalog-constraints.xml</constraint-mapping>
<constraint-mapping>META-INF/validation/customer-constraints.xml</constraint-mapping>
<property name="com.acme.validation.logging">WARN</property>
<property name="com.acme.validation.safetyChecking">failOnError</property>
</validation-config>
<!-- APPROACH #2 -->
<?xml version="1.0" encoding="UTF-8"?>
<validation-config
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"
version="1.1">
<default-provider>com.acme.ACMEProvider</default-provider>
<message-interpolator>com.acme.ACMEAwareMessageInterpolator</message-interpolator>
<executable-validation>
<disabled/>
<default-validated-executables>
<executable-type>NONE</executable-type>
</default-validated-executables>
</executable-validation>
<constraint-mapping>META-INF/validation/order-constraints.xml</constraint-mapping>
<constraint-mapping>META-INF/validation/catalog-constraints.xml</constraint-mapping>
<constraint-mapping>META-INF/validation/customer-constraints.xml</constraint-mapping>
<property name="com.acme.validation.logging">WARN</property>
<property name="com.acme.validation.safetyChecking">failOnError</property>
</validation-config>
<!-- SCHEMA PROPOSAL -->
<xsd:element name="disable-executable-validation" type="xsd:boolean"
default="true" minOccurs="0" maxOccurs="1">
</xsd:element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment