You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Douglas Ferlini (JIRA)" <de...@myfaces.apache.org> on 2012/07/27 10:19:33 UTC

[jira] [Created] (TOMAHAWK-1632) Verstion for 1.2 - TAG saveState - does not save full bean

Douglas Ferlini created TOMAHAWK-1632:
-----------------------------------------

             Summary: Verstion for 1.2 - TAG saveState - does not save full bean
                 Key: TOMAHAWK-1632
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1632
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: UISaveState
    Affects Versions: 1.1.13
         Environment: Debian and windows XP, jboss 7.1, jdk 7
            Reporter: Douglas Ferlini
            Priority: Minor


This code isn't saving object state <t:saveState value="#{user}" /> 
But this code does save my user.name value <t:saveState value="#{user.name}" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TOMAHAWK-1632) Verstion for 1.2 - TAG saveState - does not save full bean

Posted by "Douglas Ferlini (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425503#comment-13425503 ] 

Douglas Ferlini commented on TOMAHAWK-1632:
-------------------------------------------

User bean class:

public class User implements Serializable{
...
}


faces-config.xml :

<managed-bean>
  <description>User Name Bean</description>
  <managed-bean-name>user</managed-bean-name>
  <managed-bean-class>demo.User</managed-bean-class>
  <managed-bean-scope>request</managed-bean-scope>
 </managed-bean>
                
> Verstion for 1.2 - TAG saveState - does not save full bean
> ----------------------------------------------------------
>
>                 Key: TOMAHAWK-1632
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1632
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: UISaveState
>    Affects Versions: 1.1.13
>         Environment: Debian and windows XP, jboss 7.1, jdk 7
>            Reporter: Douglas Ferlini
>            Priority: Minor
>
> This code isn't saving object state <t:saveState value="#{user}" /> 
> But this code does save my user.name value <t:saveState value="#{user.name}" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TOMAHAWK-1632) Verstion for 1.2 - TAG saveState - does not save full bean

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471143#comment-13471143 ] 

Leonardo Uribe commented on TOMAHAWK-1632:
------------------------------------------

I didn't notice before this problem, but recently on a discussion on dev list, it was mentioned this problem too.

Checking the code, I understood that the problem is caused because <t:saveState> relies on JSF 1.2 state saving behavior, which uses restoreState(FacesContext context, Object state) to store back the bean into the current context or request. So, if you swich to JSF 1.2 state saving (set javax.faces.PARTIAL_STATE_SAVING web config param to false) will solve the problem. In theory it should work with JSF 2 and partial state saving enabled, but probably since you are in JBoss 7.1, jboss serialization could cause some problem with t:saveState, so the best bet is make your bean implement StateHolder interface and implement saveState and restoreState methods.

But thinking more in deep this problem, I think the best is deprecate this component. The reason is the view should not change the context, and it is a better practice to let in one side the business beans and in the other side the information that is relevant to the view and its state.

For now I'll add the necessary comments in t:saveState documentation and I'll close this issue as cannot reproduce.
                
> Verstion for 1.2 - TAG saveState - does not save full bean
> ----------------------------------------------------------
>
>                 Key: TOMAHAWK-1632
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1632
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: UISaveState
>    Affects Versions: 1.1.13
>         Environment: Debian and windows XP, jboss 7.1, jdk 7
>            Reporter: Douglas Ferlini
>            Priority: Minor
>
> This code isn't saving object state <t:saveState value="#{user}" /> 
> But this code does save my user.name value <t:saveState value="#{user.name}" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TOMAHAWK-1632) Verstion for 1.2 - TAG saveState - does not save full bean

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424820#comment-13424820 ] 

Leonardo Uribe commented on TOMAHAWK-1632:
------------------------------------------

Could you please provide an example of the backing bean definition? Does it implements Serializable or StateHolder interface? As long as I can remember, everything works as expected, because the code is the same one from 1.2/1.1 module, and it does not have any changes in 2.0.
                
> Verstion for 1.2 - TAG saveState - does not save full bean
> ----------------------------------------------------------
>
>                 Key: TOMAHAWK-1632
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1632
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: UISaveState
>    Affects Versions: 1.1.13
>         Environment: Debian and windows XP, jboss 7.1, jdk 7
>            Reporter: Douglas Ferlini
>            Priority: Minor
>
> This code isn't saving object state <t:saveState value="#{user}" /> 
> But this code does save my user.name value <t:saveState value="#{user.name}" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira