[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4347) NullPointerException in UISelectItems when var attribute is not specified in s:selectItems

Julien Kronegg (JIRA) jira-events at lists.jboss.org
Mon Aug 10 09:45:29 EDT 2009


NullPointerException in UISelectItems when var attribute is not specified in s:selectItems
------------------------------------------------------------------------------------------

                 Key: JBSEAM-4347
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4347
             Project: Seam
          Issue Type: Bug
    Affects Versions: 2.1.2.GA
            Reporter: Julien Kronegg
            Priority: Minor


When having a <s:selectItems value="#{myList}"/> , a NullPointerException is raised:

        java.lang.NullPointerException
	at com.sun.faces.context.RequestMap.put(ExternalContextImpl.java:1066)
	at org.jboss.seam.ui.component.UISelectItems$ContextualSelectItem.setup(UISelectItems.java:73)
	at org.jboss.seam.ui.component.UISelectItems$ContextualSelectItem.create(UISelectItems.java:90)
	at org.jboss.seam.ui.component.UISelectItems.asSelectItems(UISelectItems.java:195)
	at org.jboss.seam.ui.component.UISelectItems.getValue(UISelectItems.java:166)
	at org.ajax4jsf.util.SelectUtils.getSelectItems(SelectUtils.java:84)
	at org.richfaces.renderkit.InplaceSelectBaseRenderer.getItemLabel(InplaceSelectBaseRenderer.java:175)
        ....

>From the referenced forum thread and from UISelectItems.java:73, it turns out that the var attribute is not specified.

Instead of an ugly NPE, Seam should fail gracefully by one of these solutions:
1) throwing a comprehensive exception message
2) having a property "var" as mandatory

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list