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

Bug in check for required attribute at Composite Components

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.12
    • 2.0.19, 2.1.13
    • None
    • None

    Description

      The check for required attributes at Composite Components in CompositeComponentResourceTagHandler does not parses literal booleans right. It uses Boolean.getBoolen(systemProperty) which looks up a System property with the given name. Boolean.valueOf(string) should be used instead:

      CompositeComponentResourceTagHandler.createComponent(FaceletContext)

      Object value = ve.getValue(facesContext.getELContext());
      Boolean required = null;
      if (value instanceof Boolean)

      { required = (Boolean) value; }

      else if (value != null)

      { required = Boolean.valueOf(value.toString()); }

      if (required != null && required.booleanValue())
      {
      Object attrValue = this.tag.getAttributes().get (propertyDescriptor.getName());

      if (attrValue == null)

      { throw new TagException(this.tag, "Attribute '" + propertyDescriptor.getName() + "' is required"); }

      }

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            hoersch dennis hoersch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: