You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by victor ying <vy...@yahoo.com> on 2006/04/06 06:05:30 UTC

common validator issues

Hi All,
     I am using struts 1.2.7 and related Apache commons validator. I am using validation.xml(whose rules are defined by validator-rules.xml
  I need your insight of following issues
  1.How do I validate open set data range,e,g (1,10) where 1 and 10 are exclusive, current intRange/floatRange valiation only support close set data range validation where bounds are included?
  2.I find a limitation of common validator. i.e if I enter +1000 in a field that has "integer" validation turned on, the common validator will complain about this field is NOT integer something like that. Is this a bug?
  3.A more complicated scenario, suppose that I need to validator two fields,say x and y, the data range of y is dependent on x, e.g y must be the range of [x,100], how do I make use of the common validator to do that? I know I can write my customized plugged in validator to do it, but does validator provides a default way to do it?
  Many thanks in advance!
--Victor

		
---------------------------------
Blab-away for as little as 1ยข/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.

Re: common validator issues

Posted by Niall Pemberton <ni...@gmail.com>.
On 4/6/06, victor ying <vy...@yahoo.com> wrote:
> Hi All,
>     I am using struts 1.2.7 and related Apache commons validator. I am using validation.xml(whose rules are defined by validator-rules.xml
>  I need your insight of following issues
>  1.How do I validate open set data range,e,g (1,10) where 1 and 10 are exclusive, current intRange/floatRange valiation only support close set data range validation where bounds are included?

Write your own validator.

>  2.I find a limitation of common validator. i.e if I enter +1000 in a field that has "integer" validation turned on, the common validator will complain about this field is NOT integer something like that. Is this a bug?

Both the server side and client side validators use the parse integer
functions to validate and "+" is not accepted by those.

>  3.A more complicated scenario, suppose that I need to validator two fields,say x and y, the data range of y is dependent on x, e.g y must be the range of [x,100], how do I make use of the common validator to do that? I know I can write my customized plugged in validator to do it, but does validator provides a default way to do it?

No it doesn't

Niall

>  Many thanks in advance!
> --Victor

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