myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kent Tong <>
Subject Re: Serialization issue with app scoped beans referenced by session scoped beans
Date Thu, 07 Feb 2008 07:48:44 GMT

Simon Kitching-4 wrote:
> Of course this does only apply to the fairly rare case of injecting an
> app-scope reference into a session-scoped bean. I cannot see any similar
> problems when injecting session-scope into session-scope, or anything
> into a request-scoped bean.

Thanks for the confirmation. However, I don't understand why you say this
is a rare case. For example, if a session-scoped shopping cart is storing
a list of product IDs. For a page to display the content of the shopping
it needs not only product IDs, but product names and prices and etc.
To do that, one solution is to inject a Catalog app-scoped bean into the 
shopping cart bean (and thus this case occurs). Another solution (which I
now use) is to create an extra request-scoped bean like CartDisplayHelper 
into which we'll inject both the shopping cart and the Catalog.

Are you saying the second solution is your default? That is, you always have
a Java class specifically created for a specific page? I find it against the
spirit of JSF that there should be no UI logic in Java code.

Kent Tong
Wicket tutorials freely available at
Axis2 tutorials freely available at
View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message