[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-4032) Page scope throws exception when setting null value

Norman Richards (JIRA) jira-events at lists.jboss.org
Thu Mar 26 16:58:38 EDT 2009

     [ https://jira.jboss.org/jira/browse/JBSEAM-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Richards closed JBSEAM-4032.

    Fix Version/s: 2.1.2.CR1
       Resolution: Done

The underlying page context can throw an exception when setting a null value.  I've added a null check.  It's possible that throwing a better exception is in order, but this fix makes the behavior the same as with other contexts that internally convert a set null into a remove operation.

> Page scope throws exception when setting null value
> ---------------------------------------------------
>                 Key: JBSEAM-4032
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4032
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1.GA
>            Reporter: Matthew Lieder
>            Assignee: Norman Richards
>             Fix For: 2.1.2.CR1
> The following code will cause an unhelpful NPE to be thrown by JSF when the factory is accessed:
> @Name("someComponent")
> @Scope(ScopeType.PAGE)
> public class SomeComponent implements Serializable {
> @Factory("someVar")
> public String getSomeVar() {
> return null;
> }
> }
> While I believe I remember reading that using that particular type of factory method on a page-scoped component isn't supported (supported by the fact that removing the @Scope makes it work), the exception should at least be somewhat helpful in debugging the problem. NPE's with no messages are about as unfriendly as one can get.

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