Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 29403 invoked from network); 27 Sep 2010 11:38:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Sep 2010 11:38:49 -0000 Received: (qmail 32971 invoked by uid 500); 27 Sep 2010 11:38:49 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 32726 invoked by uid 500); 27 Sep 2010 11:38:46 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 32718 invoked by uid 99); 27 Sep 2010 11:38:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 11:38:45 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of niehoff.matthias@googlemail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 11:38:38 +0000 Received: by wwb18 with SMTP id 18so2310569wwb.0 for ; Mon, 27 Sep 2010 04:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:thread-index:content-language; bh=yIfEqXmUFUo5sUEMRTyVmGiba1a4V3kmSw51nnv6giY=; b=JL8xwhLEyFRG3TAi0rqGYxMxMY+tFXtT+n6+tzRGfCplTMIP1i5R/L5T7067LHIgcp 56O+/7JYv0iMdpmCsiMSY5dTWLbX+MhWXkaP9UUS8OHqZf54gPxwOq935RaM6Mnu3icR +7We61qp52sZhtYznE7WfRoZaDIklIFYppIWg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; b=ZxToqAksSMDl38zDJdDTL+dmGPcX9rjicoxitZbZHBXZBm8ggpDO78f3NJPgN+rOAb UdMcmjgQkJjY5NxjiFnG2kL2T/QWaAq8Quxet91n9b2ehwQRwDmhE9dyAA3ruBi3epEf BAyTJpxOVbwPkfg8rTnk5b2oCq8NkLpZqBZeM= Received: by 10.227.72.213 with SMTP id n21mr6252704wbj.66.1285587497656; Mon, 27 Sep 2010 04:38:17 -0700 (PDT) Received: from MatthiasLaptop (dslb-084-062-090-218.pools.arcor-ip.net [84.62.90.218]) by mx.google.com with ESMTPS id bj11sm4541338wbb.10.2010.09.27.04.38.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Sep 2010 04:38:17 -0700 (PDT) From: "Matthias Niehoff" To: "'MyFaces Discussion'" References: <000601cb5e36$339f1660$9add4320$@googlemail.com> <4CA080D8.7070103@gmx.at> In-Reply-To: <4CA080D8.7070103@gmx.at> Subject: AW: Bean Validation (JSR 303) Date: Mon, 27 Sep 2010 13:38:15 +0200 Message-ID: <000001cb5e38$7bcc57c0$73650740$@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQErVxXwCfAWxjarmMC5J0MBxqBjhwI6IEiHlFPxSvA= Content-Language: de X-Virus-Checked: Checked by ClamAV on apache.org Yes, using Hibernate Validator 4.1.0 Final and Validation API 1.0.0. Is there anything else to configure? Regards Matthias -----Urspr=FCngliche Nachricht----- Von: Michael Kurz [mailto:michi.kurz@gmx.at]=20 Gesendet: Montag, 27. September 2010 13:33 An: users@myfaces.apache.org Betreff: Re: Bean Validation (JSR 303) Do you have a bean validation implementation like Hibernate Validator on your classpath? regards Michael Am 27.09.2010 13:21, schrieb Matthias Niehoff: > Hi, > > I'm trying to realize Bean Validation. I annotated my attributes and=20 > set javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL true. > Furthermore I added a h:message tag in my form. When I test the=20 > validation nothing happens. The input is accepted (and in my case persisted). > Relevant parts of the Code: > > Web.xml > > > > javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NUL > L am-name> > true > > > > javax.faces.VALIDATE_EMPTY_FIELDS > auto > > > User.java > > import javax.validation.constraints.NotNull; > import org.hibernate.validator.constraints.Email; > > public class User { > @NotNull > private String nachname; > @NotNull > private String vorname; > @NotNull > private String userID; > @NotNull > private String password; > @NotNull > @Email > private String email; > @NotNull > private String role; > ... > } > > UserBean.java > > @ManagedBean > @SessionScoped > public class UserBean { > =09 > private User user =3D new User(); > > public void setUser(User user) { > this.user =3D user; > } > > public User getUser() { > return user; > } > > public String save() { > [...] > return "/admin/user/showUser.xhtml"; > } > [...] > } > > And last but not least: > editUser.xhtml > > > > > > > /> > > /> > > > > > > value=3D"#{userBean.user.password}" /> > value=3D"Speichern" /> > > > > > Did I miss a point? I thougt it would only be annotating the Beans. > > Thanks for your help! > > Matthias Niehoff >