myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (TOMAHAWK-1632) Verstion for 1.2 - TAG saveState - does not save full bean
Date Sun, 07 Oct 2012 05:11:04 GMT

    [ 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

Mime
View raw message