IBM Support

PI47600: The "class" attribute cannot be set in a custom tag in JSF 2.2

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Html "class" attributes cannot be used on custom tags in
    facelets; JSF 2.2 returns an error page if any are used.
    The current workaround is to use the "styleClass" tag, which
    has the same functionality but is not ideal.
    
    The following exception is thrown:
    Caused by: java.lang.IllegalArgumentException: Component
    property class is not writable
    at
    javax.faces.component._ComponentAttributesMap.setComponentPr
    operty(_ComponentAttributesMap.java:709)
    at
    javax.faces.component._ComponentAttributesMap.put(_Component
    AttributesMap.java:584)
    at
    javax.faces.component._ComponentAttributesMap.put(_Component
    AttributesMap.java:55)
    at
    org.apache.myfaces.view.facelets.tag.jsf.ComponentRule$Liter
    alAttributeMetadata.applyMetadata(ComponentRule.java:52)
    ... 1 more
    
    This issue is resolved in
    https://issues.apache.org/jira/browse/MYFACES-4003.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  IBM WebSphere Application Server Liberty    *
    *                  Profile version 8.5.5 users of JavaServer   *
    *                  Faces (JSF) MyFaces 2.2                     *
    ****************************************************************
    * PROBLEM DESCRIPTION: The "class" attribute cannot be set in  *
    *                      a custom tag in JSF 2.2                 *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Using native JSF tags, setting the "class" attribute performs
    correctly.  However, using custom tags, setting the "class"
    attribute results in the following exception:
    
    Caused by: java.lang.IllegalArgumentException: Component
    property class is not writable
    at
    javax.faces.component._ComponentAttributesMap.setComponentProper
    ty(_ComponentAttributesMap.java:709)
    at
    javax.faces.component._ComponentAttributesMap.put(_ComponentAttr
    ibutesMap.java:584)
    at
    javax.faces.component._ComponentAttributesMap.put(_ComponentAttr
    ibutesMap.java:55)
    at
    org.apache.myfaces.view.facelets.tag.jsf.ComponentRule$LiteralAt
    tributeMetadata.applyMetadata(ComponentRule.java:52)
    ...
    

Problem conclusion

  • The JSF MyFaces 2.2 code was updated to allow the "class"
    attribute to be set in custom tags.
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 8.5.5.8.  Please refer to the Recommended Updates page for
    delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

  • The "styleClass" tag can be used in place of "class" - JSF
    ultimately renders that attribute as "class".
    

Comments

APAR Information

  • APAR number

    PI47600

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2015-08-26

  • Closed date

    2015-09-04

  • Last modified date

    2015-09-04

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
17 October 2021