Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0EBC010872 for ; Sat, 30 Nov 2013 17:48:39 +0000 (UTC) Received: (qmail 65556 invoked by uid 500); 30 Nov 2013 17:48:38 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 65504 invoked by uid 500); 30 Nov 2013 17:48:38 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 65497 invoked by uid 99); 30 Nov 2013 17:48:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Nov 2013 17:48:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Nov 2013 17:48:37 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F302D2388994 for ; Sat, 30 Nov 2013 17:48:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r888633 - in /websites/production/cxf/content: cache/docs.pageCache docs/validationfeature.html Date: Sat, 30 Nov 2013 17:48:16 -0000 To: commits@cxf.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131130174816.F302D2388994@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Sat Nov 30 17:48:16 2013 New Revision: 888633 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 Sat Nov 30 17:48:16 2013 @@ -122,7 +122,65 @@ Apache CXF -- ValidationFeature

Bean Validation Feature

-
+ + +

Introduction

+

Among many other features, JAX-RS 2.0 specification introduces Bean Validation 1.1 support as a mandatory part of implementation. In an effort to fulfill this requirement, Apache CXF provides full-fledge validation support for JAX-RS / JAX-WS endpoints, both for request parameters and response values.

+ +

Dependencies

+

Bean Validation support in Apache CXF is implementation-independent and is built solely using API. As such, the only required dependency is:

+
+
<dependency>
+    <groupId>javax.validation</groupId>
+    <artifactId>validation-api</artifactId>
+    <version>1.1.0.Final</version>
+</dependency>
+
+
+ +

API doesn't provide implementation but there are couple of choices to pick from. Please notice that bean validation implementation is taken from the ones present in classpath. If no implementation is detected, bean validation is not available for use and constraints validation won't have any effect.

+ +

Using Hibernate Validator as bean validation provider

+

http://www.hibernate.org/subprojects/validator.html

+ +

Hibernate Validator is mature and feature-rich validation provider with full support of Bean Validation 1.1 (as of version 5.x.x which is the reference implementation for JSR 349 - Bean Validation 1.1 API). To use Hibernate Validator in your Apache CXF projects, couple of additional dependencies should be included:

+ +
+
<dependency>
+    <groupId>org.hibernate</groupId>
+    <artifactId>hibernate-validator</artifactId>
+    <version>5.0.1.Final</version>
+</dependency>
+
+<dependency>
+    <groupId>javax.el</groupId>
+    <artifactId>javax.el-api</artifactId>
+    <version>3.0-b02</version>
+</dependency>
+
+<dependency>
+    <groupId>org.glassfish</groupId>
+    <artifactId>javax.el</artifactId>
+    <version>3.0-b01/version>
+</dependency>
+
+
+ +

Hibernate Validator uses Java Expression Language 3.0 in order to provide better validation messages support so the respective EL 3.0 API and implementation dependencies should be included.

+ +

Using Apache BVal as bean validation provider

+

http://bval.apache.org/

+ +

Current stable version of Apache BVal (0.5) doesn't support Bean Validation 1.1 but the upcoming 1.1.0 should have it fully implemented (at the moment 1.1.0-alpha-SNAPSHOT could be used).

+
+
<dependency>
+    <groupId>org.apache.bval</groupId>
+    <artifactId>bval-jsr</artifactId>
+    <version>1.1.0-alpha-SNAPSHOT</version>
+</dependency>
+
+