JSF Expression Language Coercion for nulls to Non-Primitive Types Always Returns Null

Solution Unverified - Updated -

Issue

  • NullPointerException migrating older application, or from a different implementation

    java.lang.NullPointerException
    at com.sun.faces.facelets.tag.TagAttributeImpl.getBoolean(TagAttributeImpl.java:136)
    at com.sun.faces.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:91)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)

  • Documentation says org.apache.el.parser.COERCE_TO_ZERO works, but it doesn't seem to

  • Revert to EL 2.2 behavior returning default instead of: "The default coercion for nulls to non-primitive types (except String) returns nulls." from the EL 3.3 spec.

Environment

  • Red Hat JBoss Enterprise Application Platform (JBoss EAP) 7
  • Java Server Faces (JSF)
  • Java Expression Language (EL)
    • Upgrading an older application that used JSF 2.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content