You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org> on 2011/03/10 18:29:59 UTC

[jira] Commented: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005185#comment-13005185 ] 

Scott O'Bryan commented on TRINIDAD-2059:
-----------------------------------------

I guess my question is, why isn't the swf preserving the ViewState.  Seems to me to be something fairly central to JSF and they should have a way of preserving it.

That said, I'm sure there are ways Trinidad can try to simply restore the last populated state, but there would be implications on window detection and the like which would all need to be worked out.

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Priority: Blocker
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira