Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-1195

Length validator broken if "maximum" attributes is missing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.9-core
    • 1.2.10-core, 1.0.10-core
    • None
    • None

    Description

      <tr:validateLength minimum="2">

      Client side validation always results in "Enter 2 or more characters, up to a maximum of 0."
      No valid data can be entered at all.

      Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."

      See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.

      Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

      Attachments

        1. 0-or-more-not-fewer.png
          1 kB
          Stephen Friedrich
        2. 2-up-to-a-maximum-of-0.png
          1 kB
          Stephen Friedrich
        3. confused.PNG
          38 kB
          Matthias Wessendorf
        4. server-side1.PNG
          39 kB
          Matthias Wessendorf
        5. server-side2.PNG
          32 kB
          Matthias Wessendorf

        Activity

          People

            matzew Matthias Wessendorf
            sfriedrich Stephen Friedrich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: