Dave schrieb:
<t:saveState value="#{bean.a}" />
<t:saveState value="#{bean.b}" />
both a and b have a reference to object c. After restoring states, two instances of c.
a and b have their own copy of c.
Is this the expected behavior? Thanks.

Yes... what happens is that between the request both objects
are serialized and then deserialized.

What happens in your case is that the reference to c is cloned due to the deserialisation process.

saveState is not a real scoping system it is more a simulation of one, it provides pseudo scopes by constant serialisation and deserialisation of beans, so that the data is not lost over the request boundaries and you do not have to take care yourself with hundreds of hidden fields.

Reply via email to