Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2882

Validator: Using validwhen with float validation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.2 Family
    • 1.4.0
    • Unknown
    • None
    • I am using Windows XP, JDK 1.4, Struts 1.2.8

    Description

      1. This has to do with the "validwhen" validations. Especially when used with "float" as defined in validation.xml.
      Scenario: I have a field which is validated as follows:

      • It is a float.
      • It has to be > 0.

      When I input 0, the validation works correctly i.e. I get an error. But when I input 0.0, the validation does not raise an error.

      My thought is that there is a problem with the way the <var> element for the "validwhen" is parsed.

      2. Another place where I see somewhat similar behavior is as follows.
      Scenario: I have a field which is validated as follow:

      • It is a float
      • It has to <= 12

      When I input something like 4, it goes through fine i.e. I don't get an error. But when I input something like 4.5 or 4.7 or 5.3 (basically numbers with decimal points), I get an error.

      Attachments

        Issue Links

          Activity

            People

              pbenedict Paul Benedict
              hchaudh1 HC
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: