You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Marcio E Miranda <Ma...@fastsearch.com> on 2006/03/03 23:13:15 UTC
Portlet support - multiple instances of a portlet.
Hi,
How does MyFaces (or JSF for that matter) handle backing beans in
multiple instances of the same portlet? For example, let's say that I've
deployed two instances of MyPortlet in the same page of a portal.
MyPortlet defines a view which has components binded to a backing bean
that must be saved for each portlet instance, because it holds
information specific to that portlet instance (in portlet API terms, it
should be stored in the Portlet session with portlet scope).
Does JSF handle portlet scope in the managed bean creation facility (and
in EL)? If not, how would I handle that in JSF? How should I create the
backing bean and how should I reference it using EL?
Thanks,
Marcio.
Re: Portlet support - multiple instances of a portlet.
Posted by Patrick Dalla Bernardina <pa...@jfes.trf2.gov.br>.
From JSR 168.
"PLT.15.2 Session Scope
PortletSession objects must be scoped at the portlet application context
level.
Each portlet application has its own distinct PortletSession object per
user session. The portlet container must not share the PortletSession
object or the attributes stored in it among different portlet
applications or among different user sessions."
MyFacesGenericPortlet implementation uses PortletSession object to save
ManagedBeans with session scope. The JSR 168 don't say that
PortletSession is scoped per user and portlet-instance. Only per user
and portlet application.
This is not good. I think these is a problem of the specification.
On the other side, I use the same portlet application (portlet.xml) to
handle diferent portlet-instances in the same page with JBossPortal and
the problem everything works great. I think jboss portal fail to follow
the specification in this item. Maybe intentionaly.
Or maybe I misinterpreted the specification.
Marcio E Miranda wrote:
> Hi,
>
> How does MyFaces (or JSF for that matter) handle backing beans in
> multiple instances of the same portlet? For example, let’s say that
> I’ve deployed two instances of MyPortlet in the same page of a portal.
> MyPortlet defines a view which has components binded to a backing bean
> that must be saved for each portlet instance, because it holds
> information specific to that portlet instance (in portlet API terms,
> it should be stored in the Portlet session with portlet scope).
>
> Does JSF handle portlet scope in the managed bean creation facility
> (and in EL)? If not, how would I handle that in JSF? How should I
> create the backing bean and how should I reference it using EL?
>
> Thanks,
> Marcio.
>