[
https://issues.apache.org/jira/browse/MYFACES-2399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776712#action_12776712
]
Jakob Korherr commented on MYFACES-2399:
----------------------------------------
I just finished implementing the view scope and I ran into an interesting
NotSerializableException while testing:
Caused by: java.lang.NullPointerException
at
org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:174)
at
org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:388)
at
org.apache.myfaces.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106)
at
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.restoreView(FaceletViewDeclarationLanguage.java:927)
at
org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:231)
at
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:106)
at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:129)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:85)
at
javax.faces.webapp.FacesServlet._handleStandardRequest(FacesServlet.java:448)
... 13 more
And here's why: UIViewRoot uses a inner class ViewScope which extends HashMap
to publish the PreDestroyViewMapEvent, when clear is called. The problem is, if
you want to serialize an object of an inner class, the enclosing class also
needs to be serialized. The enclosing class is UIViewRoot, which is not
serializable and we don't want it to be serializable, I think.
So I'll change it to a static nested class.
> ManagedBeanResolver does not handle view scope
> ----------------------------------------------
>
> Key: MYFACES-2399
> URL: https://issues.apache.org/jira/browse/MYFACES-2399
> Project: MyFaces Core
> Issue Type: Task
> Components: JSR-314
> Affects Versions: 2.0.0-alpha
> Reporter: Jakob Korherr
> Attachments: view_scope.patch
>
>
> Testing the mojarra-example "custom-tag", I ran into the following Exception:
> 06.11.2009 12:29:18
> org.apache.myfaces.el.unified.resolver.ManagedBeanResolver putInScope
> SCHWERWIEGEND: Managed bean 'data' has illegal scope: view
> The managed bean "data" is annotated with @ViewScoped, but the
> ManagedBeanResolver does not know this scope.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.