You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2018/04/06 15:56:43 UTC

svn commit: r1027968 - in /websites/production/cxf/content: cache/docs.pageCache docs/validationfeature.html

Author: buildbot
Date: Fri Apr  6 15:56:42 2018
New Revision: 1027968

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/validationfeature.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/validationfeature.html
==============================================================================
--- websites/production/cxf/content/docs/validationfeature.html (original)
+++ websites/production/cxf/content/docs/validationfeature.html Fri Apr  6 15:56:42 2018
@@ -32,9 +32,9 @@
 <link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
 
 <script src='/resources/highlighter/scripts/shCore.js'></script>
-<script src='/resources/highlighter/scripts/shBrushBash.js'></script>
-<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
 <script src='/resources/highlighter/scripts/shBrushJava.js'></script>
+<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
+<script src='/resources/highlighter/scripts/shBrushBash.js'></script>
 <script>
   SyntaxHighlighter.defaults['toolbar'] = false;
   SyntaxHighlighter.all();
@@ -119,11 +119,11 @@ Apache CXF -- ValidationFeature
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><h1 id="ValidationFeature-BeanValidationFeature">Bean Validation Feature</h1><p>&#160;</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1508777281058 {padding: 0px;}
-div.rbtoc1508777281058 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1508777281058 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1523030165006 {padding: 0px;}
+div.rbtoc1523030165006 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1523030165006 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1508777281058">
+/*]]>*/</style></p><div class="toc-macro rbtoc1523030165006">
 <ul class="toc-indentation"><li><a shape="rect" href="#ValidationFeature-BeanValidationFeature">Bean Validation Feature</a></li><li><a shape="rect" href="#ValidationFeature-Introduction">Introduction</a></li><li><a shape="rect" href="#ValidationFeature-Dependencies">Dependencies</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#ValidationFeature-UsingHibernateValidatorasbeanvalidationprovider">Using Hibernate Validator as bean validation provider</a></li><li><a shape="rect" href="#ValidationFeature-UsingApacheBValasbeanvalidationprovider">Using Apache BVal as bean validation provider</a></li></ul>
 </li><li><a shape="rect" href="#ValidationFeature-CommonBeanValidation1.1Interceptors">Common Bean Validation 1.1 Interceptors</a>
@@ -172,11 +172,11 @@ div.rbtoc1508777281058 li {margin-left:
     &lt;version&gt;5.0.2.Final&lt;/version&gt;
 &lt;/dependency&gt;
 </pre>
-</div></div><p>Hibernate Validator uses Java Expression Language 3.0 in order to provide better validation messages support.</p><h2 id="ValidationFeature-UsingApacheBValasbeanvalidationprovider">Using Apache BVal as bean validation provider</h2><p><a shape="rect" class="external-link" href="http://bval.apache.org/">http://bval.apache.org/</a></p><p>Current stable version of Apache BVal (0.5) doesn't support Bean Validation 1.1 but the upcoming 1.1.0 will have it fully implemented (at the moment 1.1.0-alpha-SNAPSHOT could be used).</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+</div></div><p>Hibernate Validator uses Java Expression Language 3.0 in order to provide better validation messages support.</p><h2 id="ValidationFeature-UsingApacheBValasbeanvalidationprovider">Using Apache BVal as bean validation provider</h2><p><a shape="rect" class="external-link" href="http://bval.apache.org/">http://bval.apache.org/</a></p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>&lt;dependency&gt;
     &lt;groupId&gt;org.apache.bval&lt;/groupId&gt;
     &lt;artifactId&gt;bval-jsr&lt;/artifactId&gt;
-    &lt;version&gt;1.1.0-alpha-SNAPSHOT&lt;/version&gt;
+    &lt;version&gt;1.1.2&lt;/version&gt;
 &lt;/dependency&gt;
 </pre>
 </div></div><h1 id="ValidationFeature-CommonBeanValidation1.1Interceptors">Common Bean Validation 1.1 Interceptors</h1><p>JAX-RS and JAX-WS frontends can rely on the following common interceptors to get Bean Validation 1.1 done:</p><ul class="alternate"><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationInInterceptor.java">org.apache.cxf.validation.BeanValidationInInterceptor</a>: validates resource method parameters against validation constraints, raises javax.validation.ConstraintViolationException if any violations are encountered</li></ul><ul class="alternate"><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationOutInterceptor.java">org.apache.cxf.validation.BeanValidationOutInterceptor</a>: validates resource method response values against validation constraints, raises <a shape="rect" c
 lass="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/validation/ResponseConstraintViolationException">org.apache.cxf.validation.ResponseConstraintViolationException</a> if any violations are encountered.</li></ul><p>Both interceptors depend on <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/validation/BeanValidationProvider.java">org.apache.cxf.validation.BeanValidationProvider</a> which abstracts away Bean Validation 1.1 API and provides useful utility methods. This provider can be directly injected into the interceptors as a 'provider' property. Injecting the provider is optional, the interceptors will create a default provider instance if it has not been injected.</p><p>CXF exception handlers can check if a caught javax.validation.ValidationException is an instance of CXF-specific ResponseConstraintViolationException in order to find whether the failure occurr
 ed during the return value validation or not.</p><p>The provider can be initialized with javax.validation.ParameterNameProvider or <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/validation/ValidationConfiguration.java">ValidationConfiguration</a> in order to customize the way Bean Validation 1.1 implementation does its work.</p><p>Note that interceptors will only be effective if the current service object is a singleton. They will make a best effort of getting hold of a reference to the current service object, which can also be injected directly as a 'serviceObject' property.</p><p>Custom interceptors can customize the default processing (for example, see the section on Bean Validation 1.1 in JAX-RS 2.0). Typical customization is to have one of the input parameters or the response value unwrapped before it can be validated.</p><p><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/tr
 unk/core/src/main/java/org/apache/cxf/validation/BeanValidationFeature.java">org.apache.cxf.validation.BeanValidationFeature</a> can be used to register both in and out validation interceptors.</p><h2 id="ValidationFeature-Configuration">Configuration</h2><p>The following snippets show how to get Bean Validation 1.1 interceptors activated for both JAX-RS and JAX-WS services using Spring:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">