oki managed to share data across the portlets by getting the portalRuntimContex with Navigation.getPortalRuntimeContext() and then the portal session.
BUT this does not work with richfaces a4j requests ....
those requests are directly targeted to the webapp and do not go through the portal servlet, so there is no "portal" data in the request, context, session ...
I wondered if i could access a portal MBean in which i could get access to the current sessions but i have no idea if there is such a MBean ...
could someone give me some help ?
Insted of using portletSession, you can use HttpSession object to store such information, try this code snippet:
import javax.security.jacc.PolicyContext; import javax.security.jacc.PolicyContextException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest"); request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest"); HttpSession httpSession = request.getSession();
Isn't there a way to share attributes between portlets not in a same Application ?
Isn't it possible to use the <shared-session-attribute> element in portlet.xml to share attributes through session between portlet not of a same application ?
I have tried to set this element to true or to the attribute name but i'm not able to see attributes from a portlet to another.
I have tried your code in JBoss portal 2.7.2 and i got an error :
java.lang.IllegalArgumentException: unknown handler key
Well JBoss 2.7.2 implements JSR 286 so i should be able to use the shared-session-attribute but it doesn't work better...
There is no such thing as "shared-session-attribute" in the JSR-286
Yeah you're right it's just an enhancement of JSR 286.
I thought it was in the final version of the JSR...
Sorry about that.
Can anyone suggest any solution/workaround for sharing data across different pages?