Online Certifications Video

Submit Video
Home » Videos » Online Certifications

PortletSession APPLICATION_SCOPE: 168 Portlets Sharing Data

  Shared By: tutorials168portlets      Date: Jul 14      Category: Online Certifications     
The full screen video, in full resolution, can be seen here: jpa.ezhibernate.com ApplicationScope and the PortletSession An interesting aspect of the PortletSession is the fact that data stored in the PortletSession, by default, is local and accessible only to the portlet that created it. By default, data stored in the PortletSession by one portlet cannot be shared by any other portlets on the same portal page. If there are four portlets on a portal page, if they all use a PortletSession object, then each one will have a separate, unshared, PortletSession namespace. Even if two instances of the same portlet appear on a portal page, each one will have its own, unshared, PortletSession namespace. PortletSession and the PORTLET_SCOPE This default behavior is known as PORTLET_SCOPE, and has been the way the PortletSession object has behaved for years. However, developers have done nothing but moan and groan about the fact that it is incredibly difficult to share information between portlets that exist within the same portlet application (think war file), so, with the JSR-168 portlet specification, the Java Gods introduced the concept of a shared, APPLICATION_SCOPE, for the PortletSession. When a portlet shoves an object into the PortletSession, and specifies APPLICATION_SCOPE as the visibility of the data, any portlet that is part of that same portlet application, can obtain that data by providing the appropriate key when making a call to the PortletSession?s getAttribute <b>...</b>


Related Videos