You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Georg Füchsle <gi...@googlemail.com> on 2012/01/06 14:35:49 UTC

Bean-members marked with transient are not reset to null after request.

Hallo!

I had to switch the state-saving method from client to server. After
this change bean-members marked with transient are not reset to null
after request.

I use jsf1.2 (sun ri) with tomahawk and Facelets.

To exclude bean memberes from state-saving I usually marked these
members with 'transient':
For example:
private transient List<...> myList;

At least when these beans where saved via <t:saveState ... /> after
any request these values had been reset to null.
Now for another reason I had to switch the state saving from client to server.
After tis change the transient memberes are not reset after a request.


I tried both context-parameters:

  <context-param>
    <param-name>com.sun.faces.serializeServerState</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
    <param-value>true</param-value>
  </context-param>

I hoped when using a serverside serialization these values should be
reset. But it won't.

Can anybody give me a hint how to get the same behaviour as with clien
state saving?

Thanks Gio

Re: Bean-members marked with transient are not reset to null after request.

Posted by Georg Füchsle <gi...@googlemail.com>.
Hallo Mike!

Thanks for Your reply!

The scope of my bean is "request". The state is saved for some pages
using <t:saveState value="#{mbFmInfoData}" />

This bean has some members; one of them is marked transient.
When the bean had been restored after a request that had <t:saveState
for this bean set, all members had been restored inspite of this one
that was marked transient.
Now with StateSaving set to 'server' also this marked member is still filled.

Thanks,

Gio!


2012/1/6 Mike Kienenberger <mk...@gmail.com>:
> What is the scope of your bean containing the transient members?
>
> On Fri, Jan 6, 2012 at 8:35 AM, Georg Füchsle <gi...@googlemail.com> wrote:
>> Hallo!
>>
>> I had to switch the state-saving method from client to server. After
>> this change bean-members marked with transient are not reset to null
>> after request.
>>
>> I use jsf1.2 (sun ri) with tomahawk and Facelets.
>>
>> To exclude bean memberes from state-saving I usually marked these
>> members with 'transient':
>> For example:
>> private transient List<...> myList;
>>
>> At least when these beans where saved via <t:saveState ... /> after
>> any request these values had been reset to null.
>> Now for another reason I had to switch the state saving from client to server.
>> After tis change the transient memberes are not reset after a request.
>>
>>
>> I tried both context-parameters:
>>
>>  <context-param>
>>    <param-name>com.sun.faces.serializeServerState</param-name>
>>    <param-value>true</param-value>
>>  </context-param>
>>  <context-param>
>>    <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
>>    <param-value>true</param-value>
>>  </context-param>
>>
>> I hoped when using a serverside serialization these values should be
>> reset. But it won't.
>>
>> Can anybody give me a hint how to get the same behaviour as with clien
>> state saving?
>>
>> Thanks Gio

Re: Bean-members marked with transient are not reset to null after request.

Posted by Mike Kienenberger <mk...@gmail.com>.
What is the scope of your bean containing the transient members?

On Fri, Jan 6, 2012 at 8:35 AM, Georg Füchsle <gi...@googlemail.com> wrote:
> Hallo!
>
> I had to switch the state-saving method from client to server. After
> this change bean-members marked with transient are not reset to null
> after request.
>
> I use jsf1.2 (sun ri) with tomahawk and Facelets.
>
> To exclude bean memberes from state-saving I usually marked these
> members with 'transient':
> For example:
> private transient List<...> myList;
>
> At least when these beans where saved via <t:saveState ... /> after
> any request these values had been reset to null.
> Now for another reason I had to switch the state saving from client to server.
> After tis change the transient memberes are not reset after a request.
>
>
> I tried both context-parameters:
>
>  <context-param>
>    <param-name>com.sun.faces.serializeServerState</param-name>
>    <param-value>true</param-value>
>  </context-param>
>  <context-param>
>    <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
>    <param-value>true</param-value>
>  </context-param>
>
> I hoped when using a serverside serialization these values should be
> reset. But it won't.
>
> Can anybody give me a hint how to get the same behaviour as with clien
> state saving?
>
> Thanks Gio