jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] [1336-ViewScopeAndClientSideStateSaving]

From: Leonardo Uribe <leonardo.uribe_at_irian.at>
Date: Tue, 4 Nov 2014 15:39:08 -0500

Hi

I saw this issue on the issue tracker:

https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1336
ViewScope and client side state saving is broken

I just wanted to mention that JSF 2.2 javadoc of
UIViewRoot.getViewMap(boolean create) says this:

"... For reasons made clear in ViewScoped, this map must ultimately be
stored in the session. For this reason, a true value for the create
argument will force the session to be created with a call to
ExternalContext.getSession(boolean). ..."

In JSF 2.1 and earlier, view scope was stored with the view state on
client side state saving.

I remember a discussion about that in myfaces users list long time ago:

http://markmail.org/message/ojbet3r2iicdxcmh

I think the change was done to support @PreDestroy annotation when the
session is expired.

What do I miss? I understand there are reasons to have a view scope
stored with the view state (avoid ViewExpiredException or view scope
bean expiration).

Please note flow scope and flash scope are stored in session too, so
what's the deal?

Isn't better to provide a client side view scope that specifically is
stored with the view state?

regards,

Leonardo Uribe