webtier@glassfish.java.net

Re: [webtier] JSF 2.0: View scoped data should be Serializable?

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 09 Sep 2009 14:22:43 -0700

On 9/9/09 2:02 PM, webtier_at_javadesktop.org wrote:
> I put some non-Serializable data into view scope and got a warning from Glassfish. But, I went back and checked the spec (JSF_20090506.pdf) and couldn't find anywhere that said that it should be Serializable. In fact, I think there needs to be more detailed discussion of view scope in general.
>
> I already make session data Serializable to support distributed sessions and because some servers store serializable session data on disk and reconstitute it when the server is restarted. But I would like some specific guidance in the spec as to why I ought to make view-scoped data Serializable as well.
>
ViewScope is attached to the UIViewRoot. When the UIViewRoot state is
saved, it may be serialized by the StateManager implementation.
Note that this may only occur if the save view is being redisplayed as
the spec requires the scope to be cleared when navigating to different
views.


> View scope is a terrific idea, BTW. I suppose it is far too late to consider the possibility of that being the default scope, instead of request?
>
> Cheers-
>
> - Marty
> http://www.coreservlets.com
> [Message sent by forum member 'martyhall' (hall_at_coreservlets.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=363442
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>