JBoss Community Archive (Read Only)

Portlet Bridge 3.3

Portlet Session

It's possible to share data with other portlets, within the same portlet application, using name/value pairs within the PortletSession. Use the following code to set the name/value data:

Object objSession = FacesContext.getCurrentInstance().getExternalContext().getSession(false);
  try {
    if (objSession instanceof PortletSession) {
      PortletSession portalSession = (PortletSession)objSession;
      portalSession.setAttribute("your parameter name", "parameter value", PortletSession.APPLICATION_SCOPE);

A portlet application is defined as being a single Web Archive. All portlets that are part of the same WAR are considered to be within the same portlet application.

Then in your JSP or Facelets page you can retrieve the value using:

#{httpSessionScope['your parameter name']}

For more information about which EL variables are provided by the Bridge, see Provided EL Variables

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:28:52 UTC, last content change 2012-07-31 17:15:43 UTC.