Return-Path: Delivered-To: apmail-beehive-user-archive@www.apache.org Received: (qmail 10877 invoked from network); 17 Apr 2008 12:01:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Apr 2008 12:01:36 -0000 Received: (qmail 75757 invoked by uid 500); 17 Apr 2008 12:01:37 -0000 Delivered-To: apmail-beehive-user-archive@beehive.apache.org Received: (qmail 75496 invoked by uid 500); 17 Apr 2008 12:01:37 -0000 Mailing-List: contact user-help@beehive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Users" Delivered-To: mailing list user@beehive.apache.org Received: (qmail 75485 invoked by uid 99); 17 Apr 2008 12:01:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2008 05:01:37 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FRT_TODAY2,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of phjardas@gmail.com designates 209.85.162.178 as permitted sender) Received: from [209.85.162.178] (HELO el-out-1112.google.com) (209.85.162.178) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2008 12:00:54 +0000 Received: by el-out-1112.google.com with SMTP id n30so2496elf.19 for ; Thu, 17 Apr 2008 05:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=6y7OH5VY8KCq6rS6L5xKMXuf+9urozquyufY9yljgro=; b=unNp8r3xBjjhfT2Xnd2AJNta30J26MlJ7mtGGVWoY5I4E0wGA+Fw1Azu+mGRJy7Xtv+4s0o2vTJBbZ6f4UtP+KzJHjxbmiZF/tfXlFKrMGatXqS2tnIhfgpumT2nNQ+wJIk1EKQ6Is481eKwvtcn9HLEur+eTfh1e6ehW8zPuk0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=N6YDQpkRO0Cb/IPVzVxnZMIGN3KEWoqyb58BD+ro+MG6dqIr2fx3PxlaWi6UH+5Us9BnxBYOvAgUidQpATvQmg14rqWNr1IOJni5AR1wXGitQlc/00vSE7hJrFVw6ZiHMLxj/V4bQ88XPqmOIgyox8sZL1p7QctZqGfr7UysQWQ= Received: by 10.142.185.13 with SMTP id i13mr408144wff.213.1208433666808; Thu, 17 Apr 2008 05:01:06 -0700 (PDT) Received: by 10.142.180.2 with HTTP; Thu, 17 Apr 2008 05:01:06 -0700 (PDT) Message-ID: <7d9335c40804170501i55126b3udece8f91d74fe941@mail.gmail.com> Date: Thu, 17 Apr 2008 14:01:06 +0200 From: "Philipp Jardas" Sender: phjardas@gmail.com To: "Beehive Users" Subject: Re: Complex Form Bean Validation In-Reply-To: <56ef171b0804170435l1b089f77n3e550c8fd8bddff9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7d9335c40804170217o67c3f98ahe84e4a6616d9fc2b@mail.gmail.com> <56ef171b0804170232l5f7e026cneacf6dce6a248e08@mail.gmail.com> <7d9335c40804170241q7233b1aandfda43b48d1fba46@mail.gmail.com> <56ef171b0804170435l1b089f77n3e550c8fd8bddff9@mail.gmail.com> X-Google-Sender-Auth: 49927c270a3f5fd4 X-Virus-Checked: Checked by ClamAV on apache.org Hi Zuber, Thanks again for the swift response. However, I am not able to find the base class "TaggedObject" you mentioned, neither in the Beehive nor in the Struts libraries. Are you sure about the name? Thanks,

> I am not sure if this is correct way to do but you can do that by creating a > bean class by extending 'TaggedObject' class it has validate method which > you can override . > > > > Hope this will help you. > > Regards, > Zuber > > > On 4/17/08, Philipp Jardas wrote: > > > > Hi Zuber, > > > > thanks for your reply, though it didn't catch what I was thinking of. > > I am, of course, aware of the property annotations. Let me give an > > example of what I want to do: > > > > public class TestForm { > > public long getA() { ... } > > public long getB() { ... } > > > > public void validate() { > > if (getA() > 3 && getB() < 4) { > > // Add error message to B: "Must be smaller than 4 if A is > > greater than 3". > > } > > > > // even more complex validation scenarios... > > } > > } > > > > How could I possibly do this with annotations that always refer to a > > single property? > > > > Thanks, > >

> > > > On Thu, Apr 17, 2008 at 11:32 AM, zubair syed wrote: > > > Hi Philip , > > > > > > You can do this my putting validateProperty anotation of every getter > > of the > > > property. > > > > > > for ex: > > > > > > @Jpf.ValidatableProperty(validateMaxLength = > > @Jpf.ValidateMaxLength(chars = > > > 20, messageKey = "error message you can set"), validateMinLength = > > > @Jpf.ValidateMinLength(messageKey = "errror message you can set ", > > chars = > > > 5)) > > > public String getUser_id(){ > > > return user_id; > > > } > > > > > > You can also get help from beehive documentation . Hope this will help > > you. > > > > > > Regards, > > > Zuber > > > > > > > > > > > > > > > > > > > > > On 4/17/08, Philipp Jardas wrote: > > > > > > > > Hi everyone, > > > > > > > > I hope you might be able to help me with this issue. I want a form > > > > bean to perform more complex validation than what is possible with > > the > > > > property annotations. Think "if property A has the value X then > > > > property B must not be greater than Y". > > > > > > > > In Struts I would simply override the validate method. How do I do > > > > this in Beehive? > > > > > > > > Thanks for your help, > > > > Philipp > > > > > > > > > >