Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 70828 invoked from network); 28 Feb 2007 21:49:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Feb 2007 21:49:08 -0000 Received: (qmail 88147 invoked by uid 500); 28 Feb 2007 21:49:11 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 88100 invoked by uid 500); 28 Feb 2007 21:49:11 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 88089 invoked by uid 99); 28 Feb 2007 21:49:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2007 13:49:11 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of niall.pemberton@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2007 13:49:00 -0800 Received: by ug-out-1314.google.com with SMTP id 30so230326ugs for ; Wed, 28 Feb 2007 13:48:38 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=d1Nfc2jFZ87jXmQVTtL+r4OC3pzoyZIP/1IOKWtQ69ZQJMPGWd9HudFz1vLC7VsCKL02cZbI8mYgGchOgFM9v/CU2OBfo0X5ARkgV99C+xl8PH3PvcvvRRLpqujEL5hO6J20kb+pEtBjtofMLOm9ou1uCERx8p2UU9uivhk2tKA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JidJtIoCdJxSesD4JSWGEgKK8y6u7McBUKHDnTgiBNATtniu+I6KgPzvH1A/ThRPVc/ztuixT9BAVUA9Tu4ZKWDXTNlM+akShblsIXRlUQdSBmUaNjpVpCZhywPwzqlgRgHdbTYrbe87gSdiadLCCZKMGbEXQwaFIRIvn49IUdg= Received: by 10.78.158.11 with SMTP id g11mr94186hue.1172699318543; Wed, 28 Feb 2007 13:48:38 -0800 (PST) Received: by 10.78.66.6 with HTTP; Wed, 28 Feb 2007 13:48:33 -0800 (PST) Message-ID: <55afdc850702281348g631e5a02i8dd5d00989432df6@mail.gmail.com> Date: Wed, 28 Feb 2007 21:48:33 +0000 From: "Niall Pemberton" To: "Jakarta Commons Users List" Subject: Re: [validator] intRange(between 0-100) validation fails for 1234 value because of a locale issue In-Reply-To: <7f813dac0702281014g68df66dbq8ddcb33fc4141fbd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7f813dac0702281014g68df66dbq8ddcb33fc4141fbd@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org This question relates to Shale's validation rather than commons validator - you're more likely to get an answer asking this on their user list. Niall On 2/28/07, Hasan Turksoy wrote: > hi all, > > i am using an intRange validator together with an integer converter for my > input field.. code is like below; > > > > > > this means; my field will be validated for the 5<->100 range with an integer > value which will be converted by the shale's " > org.apache.shale.validator.converter.IntegerConverter" class... > > issue: > if i enter values less than 1000; validator(GenericValidator class) is > working as expected... But, if i enter values more than 1000, then, it gives > a validation error saying my field's value(1234) must be integer! > This is because when i entered a value like 1234, converter converts my > value to string (validator-rules need string value to make integer > validation) as "123.4".. so, it puts a thousand separator while converting > my value to string... in this case, GenericTypeValidator's "formatInt" > method fails while creating a new Integer from this string... It's trying to > do like; > "return new Integer("123.4");"... > > suggestion: > why this "formatInt(String value)" method of GenericTypeValidator is NOT > using overridden "formatInt(String value, Locale locale);" method with null > locale parameter?.. However, if it did like that; it will use the default > locale while parsing my string to integer... and it will work as expected... > > best regards, > > hasan... --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org