struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject RE: Validating Formatted Numbers Patch [Bugzilla 26151]
Date Fri, 16 Jan 2004 04:10:23 GMT
In principle, I'd agree with Rick, since these type of patterns are the standard way of doing
this sort of thing on the Java platform. 

But, the sticky wicket is lack of a JavaScript implementation. People would expect an implementation
like this to include client-side support, as the other validations do. 

-Ted.


On Thu, 15 Jan 2004 20:54:17 -0700, Richard Hightower wrote:
> Niall,
>
>
> I don't get a vote. I am not a committer. But if I did.... I would
> vote +1 on the idea (I have not studied your implementation). I can
> write regular expressions in a pinch, but why not support all of
> the java.text.* in the validator rules (including currencey). I
> like the idea.
>
> Rick Hightower
> Developer
>
>
> Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm
> Struts/J2EE consulting -- http://www.arc-
> mind.com/consulting.htm#StrutsMentoring
>
> -----Original Message-----
> From: Niall Pemberton [mailto:niall.pemberton@blueyonder.co.uk]
> Sent: Thursday, January 15, 2004 5:38 PM To: Struts Developers List
> Subject: Re: Validating Formatted Numbers Patch [Bugzilla 26151]
>
>
> OK so how can it be done with mask?
>
>
> also, it doesn't get more basic than numbers...if it can be done
> with mask, but its complicated, doesn't ease of use cut any ice?
>
> Niall
> ----- Original Message -----
> From: "David Graham" <grahamdavid1980@yahoo.com>
> To: "Struts Developers List" <struts-dev@jakarta.apache.org> Sent:
> Thursday, January 15, 2004 10:19 PM
> Subject: Re: Validating Formatted Numbers Patch [Bugzilla 26151]
>
>
>> The point of having the mask validation is so we don't have to
>> support all variations of patterns.  I'm -1 on adding validators
>> that duplicate what can already be done with mask.
>>
>> David
>>
>>
>> --- Niall Pemberton <niall.pemberton@blueyonder.co.uk> wrote:
>>
>>> Robert,
>>>
>>>
>>> I tried to get mask to work (although until today I had no
>>> knowledge of regular expressions) using the ORA demonstration
>>> applet and  I couldn't get it to (including your suggestion).
>>>
>>> I'm not saying regular expressions couldn't work (only I don't
>>> know how to
>>> make them!), but the pattern's used in DecimalFormat are so
>>> much more straight forward and designed for the task. Typically
>>> as people are probably
>>> using a pattern with DecimalFormat to output the data to
>>> screen, it then is
>>> much easier and intuitive to specify the same pattern for
>>> validation.
>>>
>>>
>>> I say horses for courses and to me using a number pattern to
>>> validate numbers is a better way to do it - hence the
>>> enhacement request:
>>>
>>> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26151
>>>
>>>
>>> Thanks
>>>
>>>
>>> Niall
>>>
>>>
>>>> Robert Leland wrote:
>>>>
>>>>
>>>> So using mask won't work ? (my syntax below is probably not
>>>> correct)
>>>>
>>>>
>>>> <field property="amount" depends="required,mask">
>>>> <arg0 key="sale.amount" />
>>>> <var>
>>>> <var-name>mask</var-name>
>>>> <var-value>\d,\d\d0\:\(\d,\d\d0\)</var-value> </var> </field>
>>>>
>>>
>>> I need to validate numbers which are formatted and have posted
>>> a patch to
>>> bugzilla which enhances validator the existing number
>>> validations to do this.
>>>
>>> This patch allows an optional "numberPattern" variable to be
>>> specified for
>>> the existing byte, short, integer, long, float and double
>>> validations. For Example:
>>>
>>> <field property="amount" depends="required,integer"> <arg0
>>> key="sale.amount" /> <var> <var-name>numberPattern</var-name>
>>> <var-value>#,##0:(#,##0)</var-value> </var> </field>
>>>
>>> If the pattern is specified, then java.text.DecimalFormat is
>>> used to parse
>>> the number and check if it is valid (catering for Locale).
>>>
>>>
>>> I have also posted a patch to add a new section the Validator
>>> User Guide which describes all the standard suppiled
>>> validations and shows examples of
>>> usage, including using the new "numberPattern" variable.
>>>
>>>
>>> Thanks in advance for any feedback.
>>>
>>>
>>> Niall
>>>
>>>
>>> ----------------------------------------------------------------
>>> ----- To unsubscribe, e-mail: struts-dev-
>>> unsubscribe@jakarta.apache.org For additional commands, e-mail:
>>> struts-dev-help@jakarta.apache.org
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
>> http://hotjobs.sweepstakes.yahoo.com/signingbonus
>>
>>
>> ------------------------------------------------------------------
>> --- To unsubscribe, e-mail: struts-dev-
>> unsubscribe@jakarta.apache.org For additional commands, e-mail:
>> struts-dev-help@jakarta.apache.org
>
>
> --------------------------------------------------------------------
> - To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>
>
> --------------------------------------------------------------------
> - To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message