Search in the Documentation:

How to share a simple object?

1. Get the Shared Map from the action portlet request or Jahia session.

Map map = (Map) actionRequest.getAttribute("jahiaSharedMap");

2. Put the object in the Shared Map during the portlet action phase or from a Jahia template.

map.put("date", new Date());

3. Update the Shared Map.

actionRequest.setAttribute("jahiaSharedMap", map);