We have the following problem with JSF @ViewScopedand @ManagedProperty: we have ManagedBean, which basically look like this:
@ManagedBean
@SessionScope
public class SessionConfig implements Serializable
{
}
and
@ManagedBean
@ViewScope
public class SomeController implements Serializable
{
@ManagedProperty( value="#{sessionConfig}" )
private SessionConfig sessionConfig;
}
The controller is serialized after processing the request, as expected. I expected that it @ManagedProperty sessionConfigwould be processed specifically in serialization, in particular, that after deserialization it would be “re-enabled”. However, it turns out that after deserialization sessionConfigis just an outdated clone of the actual SessionConfig-Bean.
Questions:
- Is this expected behavior?
- What can we do to make the JSF reevaluate
@ManagedPropertyafter deserialization?
We are currently “manually” re-evaluating all managed properties after deserialization. It works, but obviously does not seem to be correct.
Thank!