You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2015/09/15 03:08:45 UTC

[jira] [Commented] (MYFACES-3983) ViewScopeBinding does not work, results in an exception when using a datatable

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

Leonardo Uribe commented on MYFACES-3983:
-----------------------------------------

The reason why this happens is binding attribute does not work on view scope beans. There is a part in JSF spec that warns about the side effects of use "binding" attribute on beans with session or similar scopes. 

The problem starts in the postback. When the view is being built, the binding from the previous request is reused. Why? because the view scope bean still lives in http session. One could detect this case, but the problem is "binding" attribute is used to provide custom component creation too. I'll take a look to see if we can find a solution.

> ViewScopeBinding does not work, results in an exception when using a datatable
> ------------------------------------------------------------------------------
>
>                 Key: MYFACES-3983
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3983
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-344
>    Affects Versions: 2.2.7
>            Reporter: Anup
>            Priority: Minor
>         Attachments: ViewScopeTest.war
>
>
> Install the ViewScopeTest which was created from the following stack over flow posting: http://stackoverflow.com/questions/2797231/why-does-postconstruct-callback-fire-every-time-even-though-bean-is-viewscoped
> Drive a request to /ViewScopeTest/ViewScopeBinding.jsf 
> and click on one of the buttons.
> The following error occurs:
>  Exception thrown by application class 'javax.faces.webapp.FacesServlet.service:230' 
>   javax.servlet.ServletException: 
>  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:230)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)
> at [internal classes]
>  
> Caused by: java.lang.NullPointerException: 
>  at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.createAndQueueException(CheckDuplicateIdFaceletUtils.java:139)
> ... 1 more
> This works fine on server with Mojarra 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)