dennis hoersch created MYFACES-3748:
---------------------------------------

             Summary: Bug in check for required attribute at Composite 
Components
                 Key: MYFACES-3748
                 URL: https://issues.apache.org/jira/browse/MYFACES-3748
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.1.12
            Reporter: dennis hoersch


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");
        }
    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to