Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1467

Validation doesn't run for required fields if submitted value is null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.5-SNAPSHOT, 1.2.0-SNAPSHOT
    • Fix Version/s: 1.1.6
    • Component/s: General
    • Labels:
      None

      Description

      A component with a required value will not fail validation as expected if the submitted value is null. This issue is not seen normally because browsers send the value for an empty text field as an empty string. That is, the POST data for an empty field1 will contain the field name but no value, like field1=&field2=something. However, if you use a man-in-the-middle proxy such as Paros to remove "fieldname=" from the POST data, the submitted value will be null. UIInput.validate() skips validation for null submitted values, but since requiredness is also part of validation, the requiredness check gets skipped, too.

        Attachments

        1. patch2.txt
          2 kB
          David Chandler
        2. patch.txt
          0.7 kB
          David Chandler

          Issue Links

            Activity

              People

              • Assignee:
                matzew Matthias We├čendorf
                Reporter:
                dchandler David Chandler
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: