Hi,

from http://struts.apache.org/struts-doc-1.2.9/userGuide/dev_validator.html
we learn that:

If both items to be compared are convertable to ints, a numeric
comparison is done, otherwise a string comparison is done.

so since about any string is >= you will almost always get a valid check.

I think you want to use the doubleRange validator on the range 0.0 -
Double.MAX_VALUE (allthough I don't know if you can say that in
validation.xml, other wise just choose an unbelievably high number).

Or else, do what your are doing, but add a double validator (which you
need for doubleRange anyway). That is probably a slightly better
solution, but I don't know what happens with input like 1.2234534534.
Is it an int or a string?

mvg,
Jasper

On 5/26/06, fea jabi <[EMAIL PROTECTED]> wrote:
can someone help me with this please? thanks.


>From: "fea jabi" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
>To: user@struts.apache.org
>Subject: validation with validwhen
>Date: Thu, 25 May 2006 12:31:56 -0400
>
>want to validate a property for
>
>required,
>and also make sure it's value is greater than Zero. The value should be a
>positive double.
>
>tried the below
><field property="fee" depends="required, validwhen">
>                <msg name="required" key="lbl.required"/>
>                <msg name="validwhen" key="lbl.notvalidnumber"/>
>                <var>
>                    <var-name>test</var-name>
>                    <var-value>(*this* >= 0)</var-value>
>                </var>
>            </field>
>
>when nothing is entered by the user, getting the required message. When
>entered the characters not getting the message of validwhen.
>
>what am I missing?
>
>Thanks.
>
>_________________________________________________________________
>Don't just search. Find. Check out the new MSN Search!
>http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to