Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 2.2 Sprint 8
    • Fix Version/s: None
    • Component/s: Components/Renderers
    • Labels:
      None
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium

      Description

      We had an issue with UIInput type components regarding validation. If the user
      entered a lot of spaces in the Input field, the UIInput validator accepted the
      value as "filled out".

      We suggest to change the isEmpty function in the javax.faces.component.UIInput
      class to:

      private static boolean isEmpty(Object value) {

      if (value == null)

      { return (true); } else if ((value instanceof String) &&
      (((String) value).trim().length() < 1)) { return (true); }

      else if (value.getClass().isArray()) {
      if (0 == java.lang.reflect.Array.getLength(value))

      { return (true); }
      } else if (value instanceof List) {
      if (((List) value).isEmpty()) { return (true); }

      }
      return (false);
      }

      Where we trim the value before examining the length of it: (((String)
      value).trim().length(), so a lot of space will not be a valid value.

      Thanks.
      Description
      We had an issue with UIInput type components regarding validation. If the user entered a lot of spaces in the Input field, the UIInput validator accepted the value as "filled out". We suggest to change the isEmpty function in the javax.faces.component.UIInput class to:
      private static boolean isEmpty(Object value) {
      if (value == null)

      { return (true); } else if ((value instanceof String) &&
      (((String) value).trim().length() < 1)) { return (true); }

      else if (value.getClass().isArray()) {
      if (0 == java.lang.reflect.Array.getLength(value))

      { return (true); }
      } else if (value instanceof List) {
      if (((List) value).isEmpty()) { return (true); }


      }
      return (false);
      }
      Where we trim the value before examining the length of it: (((String) value).trim().length(), so a lot of space will not be a valid value. Thanks.
      Show »

        Activity

        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
        Hide
        Ed Burns added a comment -

        Too fundamental to change this at this point in the technology lifecycle.

        Show
        Ed Burns added a comment - Too fundamental to change this at this point in the technology lifecycle.

          People

          • Assignee:
            Unassigned
            Reporter:
            rogerk
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: