Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 32066 invoked from network); 6 Sep 2004 10:09:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Sep 2004 10:09:07 -0000 Received: (qmail 69966 invoked by uid 500); 6 Sep 2004 10:08:18 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 69849 invoked by uid 500); 6 Sep 2004 10:08:15 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 69718 invoked by uid 99); 6 Sep 2004 10:08:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [195.144.64.135] (HELO smtp1.xs4all.be) (195.144.64.135) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 06 Sep 2004 03:08:10 -0700 Received: from [193.74.195.45] (vip.schaubroeck.be [193.75.212.66]) (authenticated bits=0) by smtp1.xs4all.be (8.12.10/8.12.10) with ESMTP id i86A87Lg009396 for ; Mon, 6 Sep 2004 12:08:07 +0200 Message-ID: <413C3701.5050508@outerthought.org> Date: Mon, 06 Sep 2004 12:08:01 +0200 From: Marc Portier Organization: Outerthought User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Exception in form binding References: <413C2125.7050708@gmx.net> In-Reply-To: <413C2125.7050708@gmx.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Stephan Coboos wrote: > Hello, > > I have a form binding definition like this: > > > > > > And a bean with the corresponding getter and setter methods: > > public void setNumber(BigDecimal number)... > public BigDecimal getNumber()... > the specific conversion in binding is typically only needed when you bind to a string-only backend (ie when using xml over beans) it works between the form-datatype en assumed strings on the backend. above thus assumes fd:datatype of 'decimal' in combination with get/set string > But when I tried to save my form into the bean I got an conversion > exception: > > "org.apache.commons.jxpath.JXPathException: Exception trying to create > xpath number; Cannot modify property: foo.bar.model.Position.number; > Cannot convert value of class java.lang.String to type class > java.math.BigDecimal; Cannot convert class java.lang.String to class > java.math.BigDecimal" > > The value of the form for the field "number" is just an integer value > like "3". What can I do, to convert the values from String to BigDecimal > corectly? I haven't found any solution. > IIUC you should remove the convertor from the binding, and define your fd: type as being decimal or, if it really is integers, keep the long datatype in your form-definition, and switch the types of your property (getter/setter) on the bean > Thank you. > HTH, -marc= -- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ mpo@outerthought.org mpo@apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org